OAuthException Facebook and OSQA

469 Views Asked by At

I'm using OSQA and I simply trying to login with Facebook (without any change on the platform code), only setting 'app secret' and 'app id'.

My Facebook App settings:

Site URL: http://localhost:8080/osqa/
Canvas URL: http://localhost:8080/osqa/osqa/account/facebook/done/

I encounter this error:

{
   "error": {
      "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
      "type": "OAuthException",
      "code": 191
   }
}

and this is the url with the redirect_uri

https://graph.facebook.com/oauth/authorize?scope=email&redirect_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fosqa%2Fosqa%2Faccount%2Ffacebook%2Fdone%2F&client_id=***

I read a lot of posts concerning this problem here on stackoverflow and in other forums, I know there is a simple solution, but cannot figure out yet.

1

There are 1 best solutions below

9
On BEST ANSWER

The redirect in your URL translates to this:

redirect_uri=http://127.0.0.1:8080/osqa/osqa/account/facebook/done/

Facebook just checks the strings and sees that 127.0.0.1 is not the same as localhost. So replace this in your app settings and the redirect should work.