I\'m building a Rails API and have successfully built a way for a user to authenticate using Omniauth Identity.
We simply post to auth/identity/callback from the client,
To solve this issue the best resource I found is the rails example application in the satellizer github repo : https://github.com/sahat/satellizer/tree/master/examples/server/ruby
Your satellizer code calls the AuthController.authenticate method. This method uses the oauth model classes for each provider to convert the code you receive into an access token. Then in your user class you can retrieve the user that match the info you got from the provider.
At the end the controller method returns the jwt token to the client.
In my case the controller part is a bit different because I also use devise for mail/password authentication but I copy th oauth classes as is and it works like a charm.