Search code examples
firebaseoauth-2.0firebase-authentication

Github OAuth using Firebase - how to get user's username


I followed the Firebase's guide on how to authenticate with Github. https://firebase.google.com/docs/auth/web/github-auth

The return result from Firebase's signInWithRedirect method contains the user's displayName and email, etc. However, it doesn't seem to contain user's 'login' username which is the key for invoking most of Github's API calls.

I am sure there is a way to get it, but I just can't seem to find any documentation. Does anyone happen to know how to solve it?


Solution

  • I ended up using Github's API to get user's username with accessToken.