Firebase Auth (android) email verification status update

3,261 views
Skip to first unread message

Yaroslav Madarakh

unread,
Nov 28, 2016, 10:57:57 AM11/28/16
to Firebase Google Group
Hello!

How to get email verification update? After user email is verified, isEmailVerified remains always false, until full logout/login. 
Is it bug or is there method to fire status update? I use the last version 10.0.0.

There is similar issue with updating display name and image url https://github.com/firebase/FirebaseUI-Android/issues/409
Display name and image url updates only after logout/login. 

Thanks,
Yaroslav Madarakh

Yaroslav Madarakh

unread,
Nov 29, 2016, 10:56:24 AM11/29/16
to Firebase Google Group
Method FirebaseUser.reload() doesn't work. isEmailVerified (displayName & imageUrl also) updates only after relogin.

dev...@google.com

unread,
Dec 2, 2016, 8:36:10 PM12/2/16
to Firebase Google Group
Hi Yaroslav!
We apologize for the behavior of updateProfile in the later Android SDKs where the user profile information is not automatically updated after the call. This is a known issue and we are working to resolve it out as quickly as possible. In the meantime, you could downgrade the version of your SDK to one that worked previously (v9.6.1 should work well), or an alternative workaround to get the updated profile information is to ask the user to reauthenticate or sign-out and sign back in again after you call updateProfile. You can find an example of that using reauthenticate for an email-password user in the sample code below

//Example for an email-password user

FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();

UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()
        .setDisplayName("Jane Q. User")
        .setPhotoUri(Uri.parse("https://example.com/jane-q-user/profile.jpg"))
        .build();

user.updateProfile(profileUpdates)
        .addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                if (task.isSuccessful()) {
                    Log.d(TAG, "User profile updated. Please reauthenticate");
                }
            }
        });

String password = //gather password from user

AuthCredential authCredential = new EmailAuthCredential(user.getEmail(), password);

user.reauthenticate(authCredential);
We apologize again for this issue and look forward to having it resolved as soon as possible.

MIdhilaj M

unread,
Dec 21, 2016, 2:29:53 PM12/21/16
to Firebase Google Group
i am also facing the same problem and i try to implement  solution that provide by dev...@google.com and a another error occurred
"Error:(852, 49) error: EmailAuthCredential(String,String) is not public in EmailAuthCredential; cannot be accessed from outside package"

what to do now ?

Malcolm Deck

unread,
Dec 28, 2016, 3:26:01 PM12/28/16
to Firebase Google Group
Hey Midhilaj,

Sorry for the confusion., I can explain this. You need to use the following code snippet in place of the line that starts AuthCredential authCrededential = ...

AuthCredential authCredential = EmailAuthProvider.getCredential(user.getEmail(), password);

user.reauthenticate(authCredential);
I hope this helps!
~Malcolm

Nick Assendelft

unread,
Feb 10, 2017, 10:52:16 AM2/10/17
to Firebase Google Group
Hi guys,

I just hit this issues. Downgrading to 9.6.1 still gave me 'false' when checking isEmailVerified().
Any idea when This will be fixed in a release?

Thanks,
Nick

Kato Richardson

unread,
Feb 10, 2017, 12:14:39 PM2/10/17
to Firebase Google Group
Hi Nick,

The release notes say it was fixed in 10.0.



☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/0c515b8c-107c-4517-a751-daeac9db3af6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Kato Richardson

unread,
Feb 10, 2017, 12:18:24 PM2/10/17
to Firebase Google Group
(Okay, let's try that again without the finger mashing.)

Hi Nick,

The release notes say it was fixed in 9.6. Are you saying that you downgraded from 10.0? I wouldn't expect it to be broken there, since it was reported before the 9.6 release.

You may need to log out and back in before the user data is refreshed. I do recall some issues with that, and I don't see a fix in the release notes after a casual scan.

Please try that first and if you still aren't getting results, include a repro, version info, and some due diligence showing how you validated that it's actually verified for the given user.

☼, Kato


Nick Assendelft

unread,
Feb 10, 2017, 12:26:58 PM2/10/17
to Firebase Google Group
Hi Kato,

Actually, it says it was added.
The actual value of it is only updated when the user logs in. So when the user verifies their email then after you call that method it would return 'false'. If I log out and then log the user back in the correct value is displayed. I've just tested this myself. So It's definitely not fixed :)

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/hd6ZtwfDeyQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Kato Richardson

unread,
Feb 10, 2017, 12:50:09 PM2/10/17
to Firebase Google Group
Pretty sure we said the same thing. isEmailVerified() was added (i.e. "fixed" because it was missing from Android) in the 9.6 release, and there's still another related bug where user data is not refreshed until you sign out and then sign in again. Note this isn't specific to isEmailVerified(). 

I don't see a fix for that one in the release yet.

☼, Kato

On Fri, Feb 10, 2017 at 10:17 AM, Nick Assendelft <n.asse...@gmail.com> wrote:
Hi Kato,

Actually, it says it was added.
The actual value of it is only updated when the user logs in. So when the user verifies their email then after you call that method it would return 'false'. If I log out and then log the user back in the correct value is displayed. I've just tested this myself. So It's definitely not fixed :)

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/hd6ZtwfDeyQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-talk+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nick Assendelft

unread,
Feb 10, 2017, 3:01:13 PM2/10/17
to Firebase Google Group
Sorry, I should probably be more clear in my response. This is the situation:

- I'm on 10.0.1
- When a user is registered and FirebaseUser#isEmailVerified() is called it returns 'falses
- I request the user to verify their email using FirebaseUser#sendEmailVerification()
- the user verifies the email, comes back to the app and I call FirebaseUser#isEmailVerified() again
- this still returns 'false'
- I log the user out and then let them log in again 
- It now returns 'true' (as you mentioned)

I'm expecting that the value is updated automatically without having them to sign out and in again. My guess this is a bug. It is quite weird to have a sign up flow where the user needs to login in to an app again right after signing up. (correct my if I'm wrong here).

I previously (wrongly) thought that Malcom said that downgrading would solve this issue. But it obviously doesn't.

I hope this clears things up,
Nick

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398




--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/hd6ZtwfDeyQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Yaroslav Madarakh

unread,
Feb 20, 2017, 10:39:19 AM2/20/17
to Firebase Google Group
Update for 10.2.0:
isEmailVerified still returns false until reauthenticate.

понедельник, 28 ноября 2016 г., 18:57:57 UTC+3 пользователь Yaroslav Madarakh написал:

Bryan Chen

unread,
Mar 27, 2017, 10:40:35 AM3/27/17
to Firebase Google Group
Hi,

I use SDK 10.2.0 and found that isEmailVerified() will be updated after reload().

Yongling

Yaroslav Madarakh於 2017年2月20日星期一 UTC+8下午11時39分19秒寫道:

Ish

unread,
Feb 19, 2018, 11:10:08 PM2/19/18
to Firebase Google Group
Hi, 

    I'll second Yongling's response. I am using firebase version 11.4.0 and I can confirm that isEmailVerified() will update after you call reload().

Here is a code snippet: 
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
isEmailVerified = user.isEmailVerified();

final FirebaseAuth auth = FirebaseAuth.getInstance();
auth.getCurrentUser().reload().addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
FirebaseUser user = auth.getCurrentUser();
isEmailVerified = user.isEmailVerified();
Log.d(TAG,"OnCreate in Reload()- is Email Verified: " + isEmailVerified);
showToast("Is Email Verified: " + isEmailVerified);

}
});


Good luck.

-ish
Reply all
Reply to author
Forward
0 new messages