Search code examples
ruby-on-railsoauthdevisedoorkeeper

OAuth2::Error with doorkeeper


Whenever I try to authenticate with doorkeeper provider, I always got the following error

invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. {"error":"invalid_grant","error_description":"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}

I tried with other doorkeeper clients but still have the same error

Doorkeeper client:

  1. https://github.com/doorkeeper-gem/doorkeeper-devise-client.git
  2. http://dev.mikamai.com/post/112508735689/oauth2-on-rails-the-client-application

Doorkeeper provider:

https://github.com/doorkeeper-gem/doorkeeper-provider-app.git


Solution

  • I solved it by downgrading omniauth-oauth2 gem version to 1.3.1 mentioned here - https://github.com/intridea/omniauth-oauth2/issues/81