Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing_OAuth_Token - invalid_credentials #13

Open
ghost opened this issue Oct 3, 2014 · 12 comments
Open

Missing_OAuth_Token - invalid_credentials #13

ghost opened this issue Oct 3, 2014 · 12 comments

Comments

@ghost
Copy link

ghost commented Oct 3, 2014

ERROR -- omniauth: (salesforce) Authentication failure! invalid_credentials: OAuth2::Error, Missing_OAuth_Token

we started getting this error recently, any suggestions. It is an intermittent issue.

@dchaley
Copy link

dchaley commented Oct 6, 2014

FYI I got around this by changing a post to a get:
https://github.com/docsend/omniauth-salesforce/

and in particular,
docsend/omniauth-salesforce@a3445d8

I'm not sure if it's relevant to your issue, but it worked for me. Full disclosure: I didn't track down why changing to a get works. I just observed that it does... so, YMMV!

(BTW, this is out of date, the newly maintained version is: https://github.com/realdoug/omniauth-salesforce)

@ghost
Copy link
Author

ghost commented Oct 6, 2014

Cool,will give it a try, thanks for the response.

@msreekm
Copy link

msreekm commented Oct 7, 2014

Thanks dchaley ,that worked.

I am wondering how changing from POST to GET fixed the issue!

@dchaley
Copy link

dchaley commented Oct 7, 2014

My suspicion is that it's a Faraday version issue, because the code works as-is in the sample (which uses Faraday 0.7.6). More info in my pull request here: realdoug/omniauth-salesforce#12 (<-- that is the currently maintained site for this project, afaict)

I think it's that the POST requires the oauth_token to be part of a multipart form body, whereas the GET puts it as a parameter; I am guessing that the older version of Faraday did the right thing but the newer one is being stricter or an interface changed, or something like that.

What version of Faraday are you using @msreekm ?

@msreekm
Copy link

msreekm commented Oct 7, 2014

faraday (0.8.9) and it was working fine with version 0.8.8.

@GLandes
Copy link

GLandes commented Oct 20, 2014

Hi. I am experiencing same issue. Tried to run your application "in action" getting
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.

Thanks.
--GL

jpb added a commit to unbounce/omniauth-salesforce that referenced this issue Oct 22, 2014
@sb8244
Copy link

sb8244 commented Oct 28, 2014

Follow up that this is fixed with the latest version at realdoug.

@msreekm
Copy link

msreekm commented Oct 28, 2014

Hi sb8244- just curious, was this fixed recently @realdoug and do you know what was causing it to fail?

@sb8244
Copy link

sb8244 commented Oct 28, 2014

@msreekm yea, I fixed it. The issue (I think) is that the old way was to POST the access_token in the body of the request. This may have worked in the past, but I think that SFDC changed their encoding so that spaces in the post body trip it up. I came to this conclusion while talking to Pat Patterson at Dreamforce and he said that is a likely cause (although blamed the library and not SFDC).

In any case, the proper way of sending an access_token is always in the header and never in the url or POST body.

@kenleezle
Copy link

I had the same issue and changing the post to get fixed the issue for me.

@sb8244
Copy link

sb8244 commented Nov 7, 2014

@kenleezle pull in the latest omniauth-salesforce and it's fixed through the header method.

@realdoug
Copy link

realdoug commented Nov 8, 2014

Correct. Also, the source code for the gem is located here: https://github.com/realdoug/omniauth-salesforce so any issues, please open them under that repo.

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

No branches or pull requests

6 participants