realdoug/omniauth-salesforce — pull request #12 by dchaley (2014-10-06 09:33:40+00:00)
Title: Switch id request from get to put

When the info request is a post, I consistently get this error:
(salesforce) Authentication failure! invalid_credentials: OAuth2::Error, Missing_OAuth_Token

This is despite the post having an oauth token parameter:

post https://login.salesforce.com/id//?oauth_token=

It seems that this request doesn't have to be a get in the first place, and changing it to a get consistently makes the request succeed. I confess to not having tracked down why, *exactly*, the change works.

This is using faraday (0.9.0). Perhaps it is a faraday compatibility issue with how the post request is constructed. This working sample:
https://github.com/takahiro-yonei/OmniAuth-Salesforce-Sample
uses Faraday 0.7.6.

e.g., it could be an error in how the Oauth2 gem is constructing its post request, by having it be a param rather than in the request body.

Sorry to not be more helpful on that part -- but can we at least focus on why it's a post and not a get, and whether changing it to a get is acceptable? Because that will avoid this problem entirely.