Authenticate User Using Omniauth And Facebook For A Rails API?
Answer : the best way I found (after being stuck for a while on this issue ) is to do your omniauth2 (specifically in my case using satellizer angular plugin) manually... I'll discuss the solution for Facebook as it was my case, but everything could apply to any other provider. first you have to know how omniauth2 works (as documented for humans here)... Client: Open a popup window for user to authenticate. Client: Sign in (if necessary), then authorize the application. Client: After successful authorization, the popup is redirected back to your app. with the code (authorization code) query string parameter the redirect back url must match your front-end app url not the back-end url and it must be specified in your facebook app configurations Client: The code parameter is sent back to the parent window that opened the popup. Client: Parent window closes the popup and sends a POST request to backend/auth/facebook with code parameter. Server: code ( A...