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) "FacebookFacebookAuthorizationException Object
(
    [statusCode:FacebookFacebookRequestException:private] => 400
    [rawResponse:FacebookFacebookRequestException: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:FacebookFacebookRequestException: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

Answer

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.



Source: stackoverflow