Firebase: There is no user record corresponding to this identifier. The user may have been deleted

16,857

Solution 1

When a user updates their email, password or resets their password. Firebase Auth backend revokes their tokens requiring that they reauthenticate or try to sign in again. This is a security feature. For example a user may reset their password if their account was compromised. All other sessions must reauthenticate.

Solution 2

This is happening because the email with you are login/sign-in with does not exist, either you have to register that email it with auth.createUserWithEmailAndPassword then login/sign-up or correct your email and password.

Share:
16,857
Richard
Author by

Richard

Updated on June 17, 2022

Comments

  • Richard
    Richard almost 2 years

    I am using Ionic2/Angular2 with AngularFire2 and Firebase to authenticate my users at login.

    After I register a user via email & password successfully, I can login with that email & password successfully.

    public fireAuth: firebase.auth.Auth;
    ...
        loginFirebaseUser(email: string, password: string): firebase.Promise<boolean> {
            return this.fireAuth.signInWithEmailAndPassword(email, password).then(() => {
                console.log('signInWithEmailAndPassword', email, password);
            }).catch((error)=> {
                console.error('Error signInWithEmailAndPassword', email, password, error.name, error.message);
                throw new Error(error.message);
            });
        }
    

    When I change the users email, it updates successfully (I can see the update in the admin console and there's no errors).

    this.fireAuth.onAuthStateChanged((firebaseUser: firebase.User) => {
        firebaseUser.updateEmail(newEmail).then((data) => {...
    

    I then verify the new email successfully. However, when I try login in again with the new email and password, I get:

    There is no user record corresponding to this identifier. The user may 
     have been deleted.
    

    In summary, if I don't update the email address, everything works. If I do update the email address, I get the above error if I try log in.

  • Richard
    Richard about 7 years
    Thank for the info. How does a user reauthenticate? The user tries to log in with the new email and password, but gets the above error. Do I need to call a reuthenticate function?
  • Richard
    Richard about 7 years
    Strange thing. I am testing it this morning, and I have no issues, it works. Maybe a pc reboot removed some cache or something. Apologies, and I appreciate your help.