Omniauth with doorkeeper

I am using my own Omniauth by using doorkeeper.I also use devise. The issue is that in the callback I sign_in the user but as soon as I redirect him to the dashboard I get the current_user as nil. Dont know why the cookies/ sessions is getting wiped.

In the callback method after the sign_in method the current_user is not nil but in the dashboard show method the current_user comes as nil.


@charlieanna1, have you configured Doorkeeper’s resource_owner as instructed here ?

Hope this helps, otherwise I’m sure @Tute_Costa can help you figure this one out :slight_smile:

But this method goes in the provider right. I am unable to get the current user in the client app.

I already use this in the auth server app.

    Doorkeeper.configure do
       orm :active_record
      # This block will be called to check whether the resource owner is authenticated or not.
       resource_owner_authenticator do
        current_user || warden.authenticate!(:scope => :user)

Ah, you’re right. Have you checked out the example apps for clients? There is an example for devise that might come in handy. Other than that, I don’t think I can help much more.

Thanks for poking @pedromoreira.

@charlieanna1 I don’t remember having seen a case like that, it should work. Can you please post your callbacks controller?

I fixed the issue. I was also actually trying to so single sign on because of which I was doing something to the sessions variable and hence the current_user was disappearing.

Another issue. How do I redirect the user back to the client app after he logs in with the provider app? Currently after he logs in he is taken to the provider app dashboard.