What I do is,
I start by making a call with ajax to the controller/function “users/authenthicate”
This function get’s the loginurl from the sdk and returns it to javascript wich does the window.open.href… sofar sogood.. I get directed to the facebook loginpage,
but after a successvol login, it redirects back to the same users/authenticate.
QUESTION: is this the normal behaviour? or can I set the redirecturl..
QUESTION: it returns the url without a slash between the questionmark so the function is never recognized like this “users/authenthicate?bladeblibla”.
*I did set some url when I registred the application, but that was a completely different url
something like “http://www.domain/users/facebook_login”*
thanks Richard
You can set the redirect URI as follows:
You should also have in mind that Safari doesn’t allow setting third party cookies in an iframe, that’s why you need to redirect to your own domain first, where you set a cookie and redirect to facebook again. Otherwise you end up in an infinite loop.
I have described this method in more detail here:
Safari 3rd party cookie iframe trick no longer working?