I have implemented simple Angular 2 application which uses ASP.NET Core WebApi as backend. For authentication I added '/login' route that generates JWT access and refresh tokens that in turn stored by SPA in localStorage and used in HTTP requests.
Now I want to integrate social registration function so users can login using ie Facebook button. From users's point of view I want to perform it into 3 steps:
- Click Register by Facebook button and redirected to Facebook website (to login and confirm my app request).
- Clicked confirm and redirected to my SPA where /registration page where his name already filled from Facebook profile
- Fills the remaining fields (like his favorite toy) and clicks "Finish registration"
After this registration if user clicks register via facebook again he will be redirected to facebook (if he already logged in) he automatically redirected to server route that checks if such a user has been already registered and if it is then redirect him to SPA homepage
How to correctly integrate such a workflow in my app? Note: I want to perform authentication and registration inside my Angular2 app, not on different auth server.