Facebook login: Please make sure your redirect_uri is identical to the one you used in the OAuth dialog
Solution 1
I believed you have used different redirect_uri
in your facebook app settings and Oauth API code. thats why you got this error.
For facebook login you must set same redirect_uri into both place.
Solution 2
You can set redirect URI in Go to https://developers.facebook.com/apps Select your app.
Under Products > Facebook Login > Settings
- Enable Embedded Browser OAuth Login
- Set Valid OAuth Redirect URIs
You can Validate Redirect URI with Redirect URI Validator.
You can only use https URIs. Also set App Domain in Settings > Basic > App Domains
Try /
at the end of redirect URI
In my case I was using https://localhost
everywhere but somehow when getting access token specifying https://localhost/
worked.
Solution 3
As absurd as it sounds, verify you're using the correct app_secret.
Facebook will give you this instead of just saying "invalid secret" in the response
Uffo
Updated on July 26, 2022Comments
-
Uffo almost 2 years
So I'm out of ideas, I don't know what to check or debug anymore, but on the exception I get this:
string(188203) "Facebook\FacebookAuthorizationException Object ( [statusCode:Facebook\FacebookRequestException:private] => 400 [rawResponse:Facebook\FacebookRequestException:private] => {"error":{"message":"Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request","type":"OAuthException","code":100,"fbtrace_id":"DqCCKoiN0r4"}} [responseData:Facebook\FacebookRequestException:private] => Array ( [error] => Array ( [message] => Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request [type] => OAuthException [code] => 100 [fbtrace_id] => DqCCKoiN0r4 ) ) [message:protected] => Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request [string:Exception:private] => [code:protected] => 100
-
Uffo almost 8 yearswhere in app settings? @fire
-
Uffo almost 8 yearsWhere in app settings?
-
Dharmesh Goswami almost 8 years@Uffo In Basic or Advanced settings, you can see callback URL option.
-
Uffo almost 8 yearsuh I have that now If I add facebook login, but still doesn't work
-
Dharmesh Goswami almost 8 years@Uffo Do you have 'https' in your redirect_uri ? If yes then change it to 'http' in both place.
-
Dharmesh Goswami almost 8 years@Uffo Please check this Urls. stackoverflow.com/questions/16562602/… github.com/mkdynamic/omniauth-facebook/issues/220
-
Naumov over 6 yearsI have similar problems but can't find when set this redirect_uri
-
Tom over 4 yearsAdding the slash on the end fixed this for me (no slash was needed on the initial request)
-
Atul Yadav about 4 yearsFinally after spending like an hour!
-
stefando almost 4 yearsCan indeed confirm this is the case, I missed one character when copy/pasting the secret resulting into this error. Thanks for saving me some time!
-
Saikat Saha almost 3 yearsplease be more descriptive
-
Artem Areshko over 2 yearsAdding a slash did work for me. Looks weird...
-
Miriam Arbaji over 2 yearsThank you!! you saved me
-
Dmitry Polomoshnov about 2 yearsstrangely enough, it accepts redirect_uri without trailing
/
for oauth request, but requires/
when getting token