I'm using Firebase Admin for login in my NodeJs app. Client will login by sending an idToken (which is get from Firebase), and then NodeJs server will get the user by using admin.auth().verifyIdToken(idToken).
The result will look like this:
{ iss: 'https://securetoken.google.com/myapp-5cde1',
name: 'Manh Hung',
picture: 'https://graph.facebook.com/185960225411xxx/picture',
aud: 'xxxxxx-5cde1',
auth_time: 1526626xxx,
user_id: 'uCxxxxxxxxxxxxxxxQR4d2',
sub: 'uCwNoxxxxxxxxxxxxxxuQR4d2',
iat: 15266xxx1,
exp: 15266xxx91,
firebase:
{ identities: { 'facebook.com': [Array] },
sign_in_provider: 'facebook.com' },
uid: 'uCxxxxxxxxxxxxxxxQR4d2'
}
Yes, I got the user's registration method is by Facebook via "sign_in_provider: 'facebook.com'". But I don't know how to get user's Facebook ID. Can someone give me an advice? So many thanks!