Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Authentication with Google Identity (GoogleYOLO)

Is it possible to combine Google Identity (GoogleYOLO) with the Firebase Authentication web stack? If so, how? Thanks!

like image 975
Brandon Fan Avatar asked Jan 25 '26 13:01

Brandon Fan


1 Answers

You can sign in with googleyolo using Firebase Auth as follows:

hintPromise.then((credential) => {
  if (credential.idToken) {
    // Initialize firebase Auth credential with Google ID token
    // obtained from googleyolo.
    const cred = firebase.auth.GoogleAuthProvider.credential(credential.idToken);
    // Sign in with
    return firebase.auth().signInWithCredential(cred);
  }
  throw new Error;
}).then((result) => {
  // User signed in.
}).catch((error) => {
  // Handle error.
});
like image 185
bojeil Avatar answered Jan 28 '26 22:01

bojeil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!