Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

TOKEN_URL's order of appearance for params seems to matter #48

Open
maml opened this issue May 31, 2016 · 2 comments
Open

TOKEN_URL's order of appearance for params seems to matter #48

maml opened this issue May 31, 2016 · 2 comments

Comments

@maml
Copy link

maml commented May 31, 2016

I came across an odd issue today when I was implementing facebook authentication in development against a test app I had set up and I'm wondering if anyone else has seen it.

TOKEN_URL in facebook_authentication.rb sets the redirect_uri at the end of the string. Mine had been set and I verified that it matched what I had used for the

  • Oauth dialog request
  • my app's settings on Facebook under Settings -> Basic -> Website -> Site URL
  • and also the Valid OAuth redirect URIs under Client Settings

but I kept seeing

facebook API request failed with status 400.
facebook API error response was:
{"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191,"fbtrace_id":"FUCYqE8QrwS"}}

I noticed in the FB documentation for Manually Building a Login Flow under Exchanging code for an access token that the parameters are documented in a different order than in facebook_authentication.rb's TOKEN_URL, namely, redirect_uri appears between client_id and _client_secret instead of at the end after code.

I updated my local gem's version of TOKEN_URL to match the order of the params in the documentation and it started working. I wouldn't suspect this would matter but in my case it did.

@alfredoreduarte
Copy link

I'm having this same issue. Would you mind sharing the location of the file you edited? I can't seem to find it. Thanks!

@maml
Copy link
Author

maml commented Jul 27, 2016

@alfredoreduarte take a look at rails_api_auth/app/services/facebook_authenticator.rb

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants