isaacsanders / omniauth-stripe-connect

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

omniauth.auth returns nil #38

Closed tarr11 closed 8 years ago

tarr11 commented 8 years ago

I'm trying to use this without devise:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :stripe_connect, ENV['STRIPE_CONNECT_CLIENT_ID'], ENV['STRIPE_SECRET_KEY']
end

I see omniauth.state and omniauth.params in request.env. but not omniauth.auth

, "omniauth.params"=>{}, "omniauth.state"=>"ae5fc60ff06b7a63e92064568bb29fd05d8951df67b341e1"}, 

Debugging the strategy, it does not appear this code ever gets called:

      def build_access_token
        verifier = request.params['code']
        client.auth_code.get_token(verifier, token_params)
      end

Any thoughts?

tarr11 commented 8 years ago

turns out this was caused by me misnaming the route I used for the callback. It appears that omniauth demand it becaused /auth/stripe_connect/{something} and I had just picked a random one and it just skipped the auth on callback.

So, lesson is that call your callback route /auth/stripe_connect/callback or similar or bad things happen