Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook "Invalid redirect_uri", but the url looks fine to me

I'm getting the following error when trying to authenticate to Facebook with OAuth:

{    "error": {       "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",       "type": "OAuthException"    } } 

My url looks like this:

https://graph.facebook.com/oauth/authorize?client_id=283993944973616&redirect_uri=http://dennys-m.appspot.com/fb_login/&scope=publish_stream,email&display=popup 

I know there are a lot of other posts with this problem, but I can't see what would make my url invalid. Any ideas why I'm getting this error?

like image 629
b-ryce Avatar asked Nov 11 '11 21:11

b-ryce


People also ask

How do I get Facebook valid OAuth redirect URIs?

1. Log in to the Facebook for Developers center, and proceed to My Apps / Facebook Login (steps 1-3 above). 2. In the Valid OAuth redirect URIs field, type the redirect URI for your website and then press ENTER.

What is invalid redirect URI?

Invalid Redirect URI While working on a web based client, you have to ensure that the redirect URI passed while authentication, is the same as the one given during registration. If the redirect uri is not the one given during registration, an invalid redirect uri error will be thrown.

What is redirect URL in authentication?

A redirect URI, or reply URL, is the location where the authorization server sends the user once the app has been successfully authorized and granted an authorization code or access token.

Where is redirect URL in Facebook app?

In your app settings on https://developers.facebook.com/sa/apps/<my-app-id> , make sure that you add the Facebook Login product. Then under "Client OAuth Settings" enter the URL in the "Valid OAuth redirect URIs" box.


2 Answers

Your redirect url: http://dennys-m.appspot.com/fb_login/ must match the canvas url in https://developers.facebook.com/apps/ configuration panel.

Fortunately, these days Facebook gives the error message Invalid redirect_uri: Given URL is not allowed by the Application configuration. About a year ago no such exception appeared, just strange results.

like image 85
asdf_enel_hak Avatar answered Sep 28 '22 04:09

asdf_enel_hak


In my case there was no / at the end of mine redirect uri! No comments to fb..

like image 38
pmaruszczyk Avatar answered Sep 28 '22 05:09

pmaruszczyk