1
votes

I am trying to provide a login and registration system using own login system that is JWT(JSON Web Token) authentication and also want provide social media Login(Facebook) and registration. But my problem is how am I going to make these two complete different authentication as single consistent authentication system. Can anybody help with this.?


You can take exam of stackoverflow sign up and sign in with facebook and later it can change to its own login system.

1

1 Answers

1
votes

If you are using client side authentication from fb.

  1. Get the access token and send it to server.
  2. Authenticate the access token and get the refresh token(long time token).

If you are able to get the refresh token from server, that means that the user is valid. Now you can generate the JWT token for the user.

In case you need other information of the user before creating a JWT, then in that case you need to create an intermediate JWT token, that can be used just to get the required information. After this info is provided, you can then generate a full fledged token for the user.