Facebook OAuth redirect_uri isn't an absolute URI. Check RFC 3986.\",\"type\":\"OAuthException\",\"code\":191

StackOverflow https://stackoverflow.com/questions/20199922

Question

I've been struggling this afternoon to put my application using facebook oauth. I am getting an error while trying to get the access token:

{\"error\":{\"message\":\"redirect_uri isn't an absolute URI. Check RFC 3986.\",\"type\":\"OAuthException\",\"code\":191}}

Here is my request:

https://graph.facebook.com/oauth/access_token?code=AQD0...3X0v5EKU&client_id=XXXXX&client_secret=XXXX&redirect_uri=http%253a%252f%252flocalhost%252fMySite.Web%252fAccount%252fExternalLoginCallback%253fReturnUrl%253d%252fMySite.Web%252fAbout%252fIndex%2526__provider__%253dfacebook%2526__sid__%253d19cdb2fdc733479fa3c2df14531064a7

I appreciate any help.

Was it helpful?

Solution

Your redirect_uri starts http://localhost - This type of URL wouldn't work for almost all users of your app, and isn't allowed by Facebook as a redirect URL - it would never be retrievable from outside your own machine, for example.

You can likely work around that if you're testing on localhost by setting up another DNS entry which resolves to your local machine and use that instead - many machines setup 'localhost.localdomain' as a local DNS name for that purpose

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top