6

I am using Scribe API for facebook sign functionality, but getting following error after submitting the facebook authentication url.

callback_url = http://localhost:18080/example/pub/social/facebook/signup/step2

OAuthService service = new ServiceBuilder().provider(FacebookApi.class)
                .apiKey(apiKey).apiSecret(apiSecret)
                .scope("email")
                .callback(callbackUrl).build();

String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);

return "redirect:" + map.get("AUTHORIZATION_URL");

OAuthService service = new ServiceBuilder().provider(FacebookApi.class)
                .apiKey(apiKey).apiSecret(apiSecret).build();
Verifier verifierObj = new Verifier(verifier);
        //String s = getAccesstoken(verifier);

Token accessToken = service.getAccessToken(EMPTY_TOKEN, verifierObj)

I am getting below error @ last line

Response body is incorrect. Can't extract a token from this: '{"error":{"message":"redirect_uri isn't an absolute URI. Check RFC 3986.","type":"OAuthException","code":191}}'

Settings n facebook app :

**Website with Facebook Login** : http://localhost:18080/example/
App domain : localhost

Kindly let me know if I am wrong anywhere...New to scribe and facebook platform.

Thanks Raj

user1989933
  • 131
  • 1
  • 1
  • 4

2 Answers2

-1

Make sure you include https or http in front of the redirect_uri. And make sure you refer to it as redirect_uri.

Niraj Shah
  • 15,087
  • 3
  • 41
  • 60
-1

the callback_url is diferente of site with facebook login, change your url of site with facebook login to same to your callback_url.

Be careful with apps in to localhost, always try using one server for tests.

sorry for my poor english