2
votes

Hi hope someone can help,

For some reason when requesting access token via https://graph.facebook.com/oauth/access_token?client_id=&redirect_uri=&client_secret=&code=

The token is returned as html output and not redirected to the specified redirect_uri location

However when I request authorization via https://graph.facebook.com/oauth/authorize?client_id=&redirect_uri=&scope=offline_access,publish_stream,read_stream,publish_actions,manage_pages

This work fine. Redirect occurs with code parameter.

Any help appreciated.

Thanks

1

1 Answers

1
votes

The first one isn't somewhere you send users to, it's a URL you make a request to from your code to retrieve the access token, it's not supposed to redirect.

The purpose of the redirect_uri parameter there is to verify that you're the same app which called the auth dialog and received the code originally

You should check out the server side oauth docs if you haven't done so already: https://developers.facebook.com/docs/facebook-login/login-flow-for-web-no-jssdk/