I’m implementing a strategy to connect to an OAuth provider implemented using oauth-plugin. In the “request_phase” function, I wrote:
def request_phase
options[:response_type] = 'token
super
end
But in the HTTP request sent, it has “…&response_type=code”
I followed other examples to set response_type in request_phase as demonstrated for example with SalesForce strategy:
https://github.com/quintonwall/omniauth-rails3-forcedotcom/wiki/Build-Mobile-Apps-in-the-Cloud-with-Omniauth,-Httparty-and-Force.com
Please advise on how to change the response_type.
Thanks
Rami
As specified by the OAuth 2.0 documentation,
"code"is the only valid value for the authorization code flow:You will then have to use the
auth_codeto make a second request for a token. It’s possible the provider you’re using only supports this method.The flow that uses
tokenas a response type is the implicit grant flow, which has rather different use cases and may not be supported by the provider you’re trying to work with.