What's the purpose of the Facebook OAUTH2 redirect URL?

Go To StackoverFlow.com


I am currently redirecting to this:


I have no idea why I am required to redirect to the URL specified in my application settings, for my canvas page. The purpose behind this never seems to be mentioned.

So I redirect there, and it asks for permission to use the app... great...

Then it goes to another dialog page, and asks for additional permissions... fine...

AND THEN... it goes to that redirect URL, and then what am I supposed to do?

Am I supposed to create some sort of landing page that redirects back to the canvas page on facebook?


http://www.eeisi.com/bridge/auth.php <--- the landing page

Am I then supposed to take the resulting auth code:


and pass that back to the canvas app page, like so?



Is that how the whole thing fits together?

2012-04-04 20:46
by Jared Mark


You'll want to exchange the code query parameter for an access token.

See step 4 here: http://developers.facebook.com/docs/authentication/server-side/

You're redirected back to your app, as your app should know the application secret - which you'll need to exchange the code for an access_token.

2012-04-05 04:44
by Tom Waddington
Since posting this question I have realized that I need to be using the Javascript SDK in conjunction with the PHP SDK, and do my auth that way. Thanks for the answer - Jared Mark 2012-04-05 13:57