isaacsanders / omniauth-stripe-connect

Stripe Connect OAuth2 Strategy for OmniAuth 1.0
MIT License
130 stars 74 forks source link

Authentication failure - invalid_client: No such API key: Bearer #52

Closed micha1805 closed 6 years ago

micha1805 commented 6 years ago

Every time I try to connect to the Stripe Connect API I get this failure in authentication, 'redirecting' me to the failure method of the Omniauth callback controller :

E, [2018-05-28T13:41:50.435158 #58778] ERROR -- omniauth: (stripe_connect) Authentication failure! invalid_credentials: OAuth2::Error, invalid_client: No such API key: Bearer
{
  "error": "invalid_client",
  "error_description": "No such API key: Bearer"
}

I found in the doc that an error of invalid_client meant either one of these :
https://stripe.com/docs/connect/oauth-reference#post-deauthorize-error-codes

But i doubled checked and it's none of these.

Does anyone has an idea ?

isaacsanders commented 6 years ago

Did you fix this on your own, or move this to a different project?

csalvato commented 4 years ago

For others who may find this, when I was facing this issue, it was because I did not properly set up the omniauth initializer to include the required stripe keys:

I had set up this file:

# config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :stripe_connect, ENV['STRIPE_CONNECT_CLIENT_ID'], ENV['STRIPE_CLIENT_SECRET']
end

But forgot to put the keys into my .env file.