Skip to content
Advertisement

Get Twitter profile url from Firebase OAuth

Hello i want to get a profile Url from the Firebase OAuth response, currently firebase give this about the profile :

displayName, email, photoURL,  uid

Have you any idea if its possible ?

(I work with a serverless project)

Advertisement

Answer

You will get additional user info when the sign in attempt resolves:

firebase.auth().signInWithPopup(new firebase.auth.TwitterAuthProvider())
  .then(function(userCredential) {
    // All additional user info is available here.
    console.log(userCredential.additionalUserInfo.profile);
  })
  .catch(function(error) {
    // Error occurred.
  });

For more on this, check firebase.auth.UserCredential.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement