Ueberauth social media login on server usage on client

I don’t use social for auth I come from a node background.

When we discuss about api’s then that means that my auth page should be json no html or other fancy stuff, then vue will display the correct page after recieving the api response from auth.

Server only json - no html rendering

Client will take care of displaying the form and take actions based on the server response

Then you need to adapt guardian and uberauth to this design server json only and client html.

Look at the link i provided should offer some help.

this seems relevant: Oauth2 in Single page applications

It might work also i will delete some posts that are not relevant from the thread, i suggest you do the same maybe keep just the mix.exs and the callback function.

Also here is the link i suggested https://www.freecodecamp.org/news/authentication-using-elixir-phoenix-f9c162b2c398/

alright, thanks for the effort, it seems liek at the end it will have to be something lie this:

A bit late to join the discussion.

I accomplish what you need by sending the target URL in the state OAuth variable.
It’s not designated for this purpose, I know, but works fine.
If auth is successful, I redirect from Phoenix API app to the url from the state var, and send user login and generated auth token as GET parameters.

1 Like