jsConnect - expected sequence having logged in on authenticating site
I'm using jsConnect 1.0.3b (following advice here: http://vanillaforums.org/discussion/comment/201183) with the PHP jsConnect client library and CakePHP 2.3.6. Things are going OK so far: Vanilla is happily picking up the existence of an authenticated user if I have already logged into my website and giving me appropriate access to Vanilla. If I am not logged into my website, Vanilla offers me the option to login with it, takes me off to my login page and my website then returns something that looks OK...but I'm not sure what I/it should be doing next.
Page: mywebsite.com/index_from_jsConnectPHP.php?client_id=1234567890&Target=%2F&callback=jQuery11112223334445556666_1234567891111&_=1234567892222
contains:
jQuery11112223334445556666_1234567891111({"name":"mysuername","photourl":null})
I have read the docs here: http://blog.vanillaforums.com/jsconnect-technical-documentation/ but think I must be missing something.
Comments
OK, making progress but still not seamless. Following the instructions on ProxyConnect here (http://vanillaforums.org/page/ProxyConnect_SSO) - I know, I'm not using ProxyConnect...but - I'm now detecting whether the request to my login page comes from Vanilla and, if it does I change CakePHP Auth's redirectURL to:
$this->Auth->redirectUrl('http://myvanillasite.com');
This at least gets me back to Vanilla, but the user still has to click the 'Sign in with myothersite' link to complete the login. Any ideas on how to automate this final stage?
gets me back to Vanilla, but the user still has to click the 'Sign in with myothersite' link to complete the login. Any ideas on how to automate this final stage?
http://vanillaforums.org/addon/jsconnectautosignin-plugin
grep is your friend.
You want to redirect to: http://forums.example.com/index.php?p=/entry/jsconnect&client_id={clientID}&Target={vanilla url}
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.
Thanks @hgtonight and @x00 - the redirect to index.php worked a treat - I'll try the plugin later - looks like it'll give me single sign out too. Looking forward to unleashing my new Vanilla forum on my users....just got to sort out theming now - thanks again both.
Not quite, if give direction to set whatever url.
For sign out, just remember to delete the Vanilla cookie at the same time. If cross domain the workaround is to chain redirects to log both out.
grep is your friend.
Thanks x00 - will do. I've just blogged the whole CakePHP2/jsConnect SSO process here: https://learntech.imsu.ox.ac.uk/blog/?p=933 in case anyone else is struggling. Thanks again for all your help.