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.

I can't get the Authentication URL to work with jsConnect

HalfCatHalfCat ✭✭
edited June 2012 in Vanilla 2.0 - 2.8

Hey all,

I read the documentation and I am using the php library to do this. My output seems to work, my url is correct but the signin just prints the result instead of processing it further. My test URL looks like this:
http://MYURL/loginsuccess.php?client_id=602423412&timestamp=1338738017&signature=3ac464e5dcf09718b8b42858ccca7982&Target=/settings/jsconnect&callback=test

When I visit the site, this is what I get:

test({"email":"username@domain.tld","name":"username","photourl":"","uniqueid":1,"client_id":"654897132","signature":"998745f132f4472a7d5ff6a6587a6d9f"})

(email, username changed)
Any ideas on where I go wrong with this?

Answers

  • Ok, I am sorry. Apparently I didn't fully understand how jsConnect works. To make it work the way I thought it did by default, I had to install the "Vanilla jsConnect Auto SignIn" plugin.

  • How did you make it work, exactly? My test URL looks like yours, still jsConnect doesn't seem to be doing anything when I click on the "Sign in with" button. I also installed the Vanilla jsConnect Auto SignIn plugin, but nothing has changed.

  • Can you send me a link to your site (per PM or however you like)? Actually, this was all there is to it. If a user is signed in, and the link returns something similar to my quote, then the jsConnect Auto SignIn should work...

  • Same problem here. It does nothing. The string looks fine.

  • edited June 2012

    @HalfCat My website is not public yet, I still have to put it online. I checked it again, and the string is returned correctly, yet it doesn't log the User in.

    What did you put in the "Sign In" URL in the configuration? Mine is a Magento Sign In URL, but I'm not sure if it should perform any special action when the User is logged in or not. At the moment, when Vanilla tries to connect to Magento and the User is logged in, I just get to the e-commerce User Dashboard, not the forum.

  • HalfCatHalfCat ✭✭
    edited June 2012

    @businessdad Ok, it is extremely hard to debug without any info :)
    So, first of all your activation URL is correctly set and when you click on the Test URL in the plugin properties, you get an output similar to what I posted, right? If this is the case, usually you should be able to get logged in automatically when you visit the forum and are logged in on your site.

    To explain a bit further, this is what happens when you visit your vanilla forums (from what I understood): jsConnect detects the cookies you have set on your machine and then tries to check the activation URL if that is actually the case. Then jsConnect checks if the user that is logged in on your site also has an account on your forums by comparing the user name or the email, the user registered with. If that is the case, the user is asked to "connect" the two accounts by typing in his password (of the forum account). Now, if the user has never used the forum before, jsConnect automatically creates an account with the user name and email, he signed up with on your site.

    The "Sign In" URL is not important at all for the sign in process of vanilla. It just links the user to a page where he can sign in with your site. There is no special action required after your user is logged in. Of course it is nice for the user to be redirected back to the forum in case he clicked on the "Sign in" URL there...

  • @HalfCat Thanks for your reply. The activation URL is 100% correct, I'm sure of it. However, Vanilla doesn't seem to be doing much to try logging in the User. When I click on the "Sign in with ..." button, I simply get to the User Profile on the ecommerce. I'll make some more experiments and see what happens.

  • No good, unfortunately. Test URL works perfectly, yet Vanilla refuses to log in the User. I'm now completely stuck.

  • Eureka! I finally found the issue, in my case. Quite simply, I was calling WriteJsConnect($userData, $requestParams, $clientId, $clientSecret, $secure), but $requestParams didn't contain the callback. All I had to do was adding it, and everything works wonderfully. In code, that means:

    $requestParams['callback'] = $_GET['callback']; // Replace $_GET with any object you use in your framework

    I hope it helps. :)

Sign In or Register to comment.