pow-auth / pow_assent

Multi-provider authentication for your Pow enabled app
https://powauth.com
MIT License
321 stars 50 forks source link

[Advice] Using Pow Assent for Social Login Via API #158

Closed coladarci closed 4 years ago

coladarci commented 4 years ago

I am interested in using Pow to handle login for a new app that is 100% API; as in no controllers rendering HTML, etc - just a simple (probably GraphQL) api.

Using pow for simple email registration in an api is straight forward but I was curious how you imagined pow_assent being integrated w/ a native mobile app.

In the past, in different languages, I have had the mobile app do the login flow via FB/Instragram,etc which results in a token that can be sent to the server. The server then can use that access token w/ the library and "trust" the user is who they say they are given there are shared secrets involved.

Thanks for any advice!

danschultzer commented 4 years ago

Here's a guide for it: https://hexdocs.pm/pow_assent/0.4.6/api.html#content

So in the app you open up a browser so the user can authenticate, then for the redirect_uri/1 you'll use an app uri to return to the app with the params, and then submit them to the callback. It would be better if this could be handled natively though.

There's an issue in the Assent repo to make that possible: https://github.com/pow-auth/assent/issues/34

If Assent can accept and verify the access token, then it should be very easy to integrate with native auth flow.

coladarci commented 4 years ago

Thank you for pointing me in this direction - definitely agree that filed issue would go a long way to making this a better experience.