Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Correct jsConnect flow configuration?

AngryAntAngryAnt New
edited September 2013 in Vanilla 2.0 - 2.8

I have spent quite a bit of time trying to figure out the proper jsConnect setup and I am just about at the end of my rope.

Using jsConnect-php to integrate with my existing login system, I see the expected json output when pressing the "test" button for the configuration in the jsConnect settings.

However the actual flow is very much broken for me as I basically end up getting infinite redirection between my /login URL and my /forum URL.

Implementation and configuration is as follows:

  • /jsconnect

    • This URL expects jsConnect requests and responds with the expected json.
    • I have this configured in the jsConnect settings as "Authenticate URL".
  • /login

    • This URL checks if the client has a valid session with my login system and otherwise prompts for HTTP Auth. On success, this forwards to /forum.
    • I have this configured in the jsConnect settings as "Sign In URL".
  • /

    • This is the front page of my site. Among other functionality, this is where you create your account in my login system.
    • I have this configured in the jsConnect settings as "Register URL".
  • /logout

    • This URL invalidates the session in my login system and forwards to /.
    • I have this configured in the jsConnect settings as "Sign Out URL".
  • /forum

    • This is the root URL of the forum. /login forwards here on success.

Did I get something completely wrong here? As mentioned, the "test" button in the settings outputs json as expected, but testing the actual flow basically goes like this:

  1. Access /forum.
  2. Forward to /login.
  3. Fill out HTTP Auth prompt.
  4. Forward to /forum.
  5. Forward to /login.
  6. Goto 4.

Any ideas?

Tagged:

Comments

  • Options
    hgtonighthgtonight ∞ · New Moderator

    The user still has to log in to vanilla. Properly set up, jsConnect will add a button to "Sign in with Your Website" on the sign in form. Clicking this will check if a user is logged in (via your system) and direct them to log in on your system if needed. Then it should come back to your forums.

    Does this make sense?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    AngryAntAngryAnt New
    edited September 2013

    Great. So what could be the cause of that initial forward to /login after I am just trying to access /forum? Surely it should just give me the forum login page with said button?

    One thing that I can think of which might have an impact is that I am also using the Private Community plugin. Could this account for the difference in flow?

  • Options
    hgtonighthgtonight ∞ · New Moderator

    How does /login forward to the forums after login? Is that through Vanilla or your site?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    /login is the login page of my existing user system. It will either detect a valid session in the system and immediately forward to the forums or throw a HTTP Auth request, sign the user in and then forward to the forums.

    This is done directly by the server-side validation by passing a Location header.

  • Options

    It might be interesting to know that while I was waiting for feedback here, I went and gave ProxyConnect a try as well and I am seeing exactly the same problem.

    So clearly I am misunderstanding something somewhere in the general flow of the vanilla/garden external login support.

  • Options

    I managed to get integration going with ProxyConnect. Turns out my only issue here was that I needed to explicitly send a Content-Type: text/plain header.

Sign In or Register to comment.