socialcast / devise_oauth2_providable

Rails3 engine integrating OAuth2 authentication with Devise
MIT License
219 stars 102 forks source link

Error 500, NoMethodError (undefined method `refresh_tokens' for nil:NilClass): #26

Closed lgalabru closed 12 years ago

lgalabru commented 12 years ago

Hello there,

I'm having an issue when trying to getting an access token from an iOS client (from an in-house SDK) with my rails-3.1.1 APIs. The /authorize looks ok, and when I'm getting my authorization code and trying to post on /token, I'm experiencing some: undefined method `refresh_tokens' for nil:NilClass (development mode). It comes from tokens#create, and it looks like my env[Devise::Oauth2Providable::CLIENT_ENV_REF] is empty/nil. I do have an ugly workaround, which consist in subclassing tokens_controller and overriding the method oauth2_current_client, authenticate_user! & cie and bypassing the calls on env[xxx]. Any idea?

Regards,

wireframe commented 12 years ago

make sure that your iphone app has cookies disabled.

i'm reviewing a patch from issue #21 which may fix this as well.