I've a rails app where my users can login in it with Devise gem and Omniauth-facebook gem. They can be 'normal' users or facebook users. All of this works correctly.
I've an API in this app authenticate by Doorkeeper too. From my mobile client I can send user and password and they can access to my API with an access_token. This works correctly.
Now, I want that my facebook users will be able to access to my API through theirs facebook login from the mobile app. somebody knows how I could do this? After login with facebook, I will have a token and I will be able to access some information about the user... but how I could connect to API?
Note: When you log in the rails app with facebook, Devise creates a new user with a provider and an uid fields.
any ideas? thanks a lot.
I think you're looking for this https://github.com/doorkeeper-gem/doorkeeper-grants_assertion
I was able to achieve this by the following steps:
/facebook/login?facebook_token=XXX
Doorkeeper::Token
for that user and send it back to the client If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With