FB exchange token is missing redirect_uri

I use the FB exchange api token as follows:

https://graph.facebook.com/oauth/access_token?client_id= {client_id} 8 & client_secret = {client_secret}} & grant_type = fb_exchange_token & fb_exchange_token = {one_hour_token} & redirect_uri = HTTP% 3A% 2F% 2Fotagzcl. com% 2FfacebookCallback

I get the following error: "message": "The redirect_uri parameter is missing.", "Type": "OAuthException", "code": 191

I have my app url: otagz.cloudfoundry.com

I know that there is another question on this issue, but there is no solution for it, and this is from 2010.

Does anyone know what happened to redirect_uri?

Thanks Cristian

+8
redirect facebook facebook-oauth
source share
4 answers

If you use the CURL command-line tool, you may have the same problem as mine: just put the URL in quotation marks. See Facebook answer for this error: https://developers.facebook.com/bugs/1374437326120797

I'm not sure Facebook uses Stackoverflow as an official way of communicating. You will get a quick answer here: https://developers.facebook.com/bugs/

+10
source share

Had the same problem, resolved it by moving spaces from the url (I copied it from the facebook website, and there were a few extra spaces between the pairs)

+1
source share

I ran into your problem, but I managed to solve it using the method below. It does not require redirection

suggests that you have already received a short access token

$accessToken; $graph_url = "https://graph.facebook.com/oauth/access_token?client_id=".$your_app_id."&client_secret=".$your_app_secretkey."&grant_type=fb_exchange_token&fb_exchange_token=".$accessToken; $result = file_get_contents($graph_url); parse_str($result, $output); echo $output[access_token]; echo $output[expires]; 
0
source share

Try setting the grant_type parameter to client_credentials . The URL will look like this: https://graph.facebook.com/v2.8/oauth/access_token?client_id=XXX&client_secret=XXX&fb_exchange_token=XXX&grant_type=client_credentials

Or make it more readable:

 $q = http_build_query(array( 'client_id' => $app_id, 'client_secret' => $app_secret, 'fb_exchange_token' => $user_token, 'grant_type' => 'client_credentials' )); $url = "https://graph.facebook.com/v2.8/oauth/access_token?$q"; 
0
source share

All Articles