Facebook - OAuth Token - redirect_uri - not an absolute URL

... but this!

I call the facebook API with the following link to get the access token:

https://www.facebook.com/dialog/oauth?client_id=myclientid&redirect_uri=http%3A%2F%2Fmydomain.org%3A8080%2FServer%2FFacebookAuthenticationVerificationServlet&scope=manage_notifications,offline_access,read_mailbox,readstream

What am I doing wrong?

Facebook responds with the following error:

message: redirect_uri isn't an absolute URI. Check RFC 3986. type: OAuthException code: 191 

It should have nothing to do with this, but I use java URLEncode.encode () to encode the URL in UTF-8. I compared the result with that of JavaScript encodeURIComponent () and did not find any difference.

EDIT: Should I install the domain in my configuration? I cannot find it in the “Application Domains” (because facebook does not allow me to add domains there with the port configuration), but I set the domain as “My Site URL”.

EDIT2: Unencoded redirect uri: http://mydomain.org:8080/Server/FacebookAuthenticationVerificationServlet

EDIT3: This has nothing to do with: 8080. I tested it with php-script (the URL was like bla.domain.org/myphp.php) and sent the PHP code to the tomcat server, but the error persisted.

+6
source share
3 answers

Well, it turned out that I misunderstood the OAuth protocol. I extracted the authorizationCode code so that THEN binds me to the accessToken.

But I could not fix this error in a specific. I just reworked the procedure and implemented the autcode and sharing access tokens, and now it works fine.

Maybe unauthorize the application and re-authorize it @facebook, fix it?

+2
source

Facebook Error Code 191 -

API Error Code: 191

API Error Description: The specified URL does not belong to the application

Error message: redirect_uri does not belong to the application.

Make sure mydomain.org is in the "Application Domains" field and that the login box for the Website with Facebook is correct.

+1
source

You should not encode redirect_uri. http%3A%2F%2Fmydomain.org not understood as http://mydomain.org

+1
source

All Articles