Changing email in google workspace effect on Firebase auth identity

I had a user of my firebase android app change their email address in google workspace according to these steps to change user email.

My app uses (only) google to sign in:

val cred = GoogleAuthProvider.getCredential(account.idToken, null)
FirebaseAuth.getInstance().signInWithCredential(cred)

After the change the user is able to sign in with their new email and my app still identifies them with the same UID, but when they sign in they still see their old profile pic and their old email which the app retrieves:

FirebaseAuth.getInstance().currentUser?.let { user ->
    user.email
    user.displayName
    user.photoUrl
}

All of those properties still refer to the old email, old profile pic and old display name, but we are mainly concerned about the email property.

I'd like to know why we're still seeing the old email, and is this something that needs to be fixed on the application side or the admin/google workspace side?

1 answer

  • answered 2021-07-27 18:58 Frank van Puffelen

    Firebase Authentication creates a cached copy of the pertinent information from the OAuth provider when it first creates the account. This information is not updated afterwards, unless you do so yourself with the Admin SDK.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum