facebookoauthscribe

Scribe for FB Oauth - Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request


I am trying to use scribe for Facebook OAuth 2.0 implementation and I get below error

'{"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":"FusY4X0TorE"}}'

I used the below URL to get Token

https://www.facebook.com/dialog/oauth?granted_scopes=1&response_type=code&client_id=473486006089780&scope=email,user_about_me,user_birthday,user_location&redirect_uri=https://www.bankbazaar.com/

I create my service as below

OAuthService service = new ServiceBuilder()
                .provider(FacebookApi.class)
                .apiKey("1415540682058832")
                .apiSecret("07b182efcb587065ceef615a945d92a4")
                .callback("https://www.bankbazaar.com/")
                .build();

Let's say I get valid code/verifier from FB and use it to get access token

I print my Authorization URL and get something as below

https://www.facebook.com/v2.2/dialog/oauth?client_id=1415540682058832&redirect_uri=https%3A%2F%2Fwww.bankbazaar.com%2F

In my Facebook App page, I have the below setting enter image description here

Kindly suggest where am I going wrong ?


Solution

  • You must set redirect URL in Valid OAuth redirect URIs. It is in Settings -> Advanced, scroll down to Client OAuth Settings-> Valid OAuth redirect URIs:

    enter image description here