Social Authentication on Client Side

Okay. So, I’m writing the server-side API app for an application. The app willhave a web front end (in VueJS), as well as a mobile app. Because of this, I am kind of leaning towards doing the social Authentication on the client side and just saving the access token on the server.

So, I was thinking of having a social login function in my LoginController that obtains the user information using the ally.getUserByToken(accessToken) function.

I do have a few questions about this approach though. First, how do I tell ally which driver to use? Suppose I pass the access token to the server within the request, how would Ally know it’s a Facebook access token instead of a Google Access token?

Second is just the approach. Is there a better approach to doing this?

Thanks for the info :slight_smile:

I would use the frontend to open a window which triggers a URL handled solely by the backend performing the OAuth flow. Once the oauth flow completes, I’ll use the browser postMessage message API to send message from the newly open window to the frontend app.

Happy to answer specific questions