Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook login: Please make sure your redirect_uri is identical to the one you used in the OAuth dialog

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
like image 466
Uffo Avatar asked Jul 20 '16 09:07

Uffo


2 Answers

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.

like image 154
Aakash Yadav Avatar answered Sep 19 '22 09:09

Aakash Yadav


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

like image 40
Thomas Skubicki Avatar answered Sep 20 '22 09:09

Thomas Skubicki