0
votes

I'm throughly stumped. I can run this simple GET request in postman and have no issue, but when making it from the rails api running locally it fails with this error. I have tried using my localhost, ipadress and in this latest attempt just the route and still having an issue.

Here is the documatation on this request

The Error

{ "error":
   { 
     "message": "Missing redirect_uri parameter.",
     "type":"OAuthException",
     "code":191,
     "fbtrace_id":"BjAByCFGkQL"
   }
} 

The Request

https://graph.facebook.com/oauth/access_token?client_id=123456789&client_secret=123456789&redirect_uri=/my_auth_callback&grant_type=client_credentials

1
The redirect URI needs to be an absolute URL. And btw., if you read that section of the documentation you linked to to the end - you don’t need to make an extra API call to get an app access token, app id and secret can be used for that directly. - CBroe
@CBroe that is good to know and will try this tonight! - Tall Paul
@CBroe The issue ended up being there was an issue with ruby's get request and switched that and it started working, but if you want to put an answer about the shorter way to make that same request I would happily upvote that as it saves me a call. - Tall Paul

1 Answers

2
votes

The redirect URI needs to be an absolute URL.

And btw., you don’t need to make an extra API call to get an app access token, app id and secret can be used for that directly:

app_id|app_secret

is always a valid app access token.