Ad
How To Add Scope For Additional Details Of GitHub (Sign In) User In Firebase
I've implemented GitHub login for my app using firebase. I'm able to get email, UID and other details for logged in user. But the DisplayName is empty.
Can anyone let me know how to get the displayName from GitHub.
Thanks in advance...
Ad
Answer
You can get all GitHub user profile data immediately after sign-in, via AdditionalUserInfo
.
Here is an example with the web API:
firebase.auth().signInWithPopup(new firebase.auth.GithubAuthProvider())
.then((userCredential) => {
// Get the GitHub username.
console.log(userCredential.additionalUserInfo.username);
// Get GitHub additional user profile.
console.log(userCredential.additionalUserInfo.profile);
})
.catch((error) => {
// An error occurred.
});
Ad
source: stackoverflow.com
Related Questions
- → Make a Laravel collection into angular array (octobercms)
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → Angularjs not working inside laravel form
- → Analysis of Flux implementations
- → how to write react component to construct HTML DOM
- → angular ng-repeat and images in a row
- → Conditional BG Color on AngularJS
- → Should I 'use strict' for every single javascript function I write?
- → getting the correct record in Angular with a json feed and passed data
- → "Undefined is not a function" at .toBe fucntion
- → angularjs data binding issue
- → Angular / JavaScript auto hydrate an instance
- → Convert generic text string in json object into valid url using Angular
Ad