I am using React as Front end. and i used react-google-login and react-facebook-login for login with Google and Facebook.
It gives me accesstoken in front end.
I passed this accesstoken to backend (I am using Node with hapi).
But in backend, how can I get the userDetails from Google or Facebook using the accesstoken and pass refresh token to get new accesstoken?
Update:
OK There is Three steps in google oauth2 process .
- take authorization code
- Exchange authorization code to get access token
- pass access token to get user info
when i decouple front end and back end . In these three steps what are all i should do in front end and in back-end. in security aspects ?