Hello,
I notice that ASP.NET Zero supports some Social Logins and I can see how to enable those using the Angular application. However, is it possible to do the same thing if we develop our own mobile app using React native? What would be the proper way to enable social logins on a mobile web app?
3 Answer(s)
-
0
Hi @andry3ag
Your should implement it your self o nyour mobile app. Social Login flow for angular app works like this;
- App redirects (or opens a popup in some cases) user to login provider website
- User logins on external website
- User is redirected back to AspNet Zero Angular app with a token
- Angular app sends this token to server app
- Server app validates token by communicating with login provider
- Server app creates a local user entity if this is the first login
- Server app returns AspNet Zero token to Angular app
In your case, you must implement steps 1-4, AspNet Zero server app will handle other steps. You can search for libraries for React Native to do this.
-
0
Hi @ismcagdas,
For step 5 that you explained, is the end point on ASP.NET Zero /api/TokenAuth/ExternalAuthenticate? We have setup the social logins for the three apps below and this this what it returns
Facebook returns: id,email,image,name,first_name,last_name
Twitter returns: {"authToken","authTokenSecret","email","name", "userID", "userName"}
Google returns: {"email", "first_name","id", "image", "last_name", "name"}
Seems only one returns a authToken. Just wanted to make sure that is the only end point the front end needs to hit for getting AspNet Zero token
Thanks agian for your time
-
0
Hi,
For step 5 that you explained, is the end point on ASP.NET Zero /api/TokenAuth/ExternalAuthenticate? We have setup the social logins for the three apps below and this this what it returns
Yes, correct.
Maybe you should configure your apps on Facebook and Google sides. When I check the source code, both providers must return an access token. You can try to run them via AspNet Zero's web interface and see if they return token or not.