Firebase 2FA not saving phone number

162 views
Skip to first unread message

Atiol Beato

unread,
Feb 26, 2024, 12:05:54 AM2/26/24
to Firebase Google Group
Hi,
I've implemented firebase 2FA which has been working great. When I registered a user with a different domain, authentication flow works fine and the user even gets an OTP. However, the 2FA flow resets and asks for user phone number everytime. Checking in firebase console shows that the phone number isn't saved. I confirmed also that the domain was included in the 'Authorized Domains' list.
Additionally, this behavior causes the token to be invalidated in a few seconds. When I save the phone number in firebase console manually, everything works as expected.
I'd be grateful if anyone can point me in the right direction. Thanks in advance.

Nohe

unread,
Feb 26, 2024, 1:34:32 PM2/26/24
to Firebase Google Group
Is this a web app? Are you remembering to call the following:


import { PhoneMultiFactorGenerator } from "firebase/auth";

const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(cred);
// Complete enrollment. This will update the underlying tokens
// and trigger ID token change listener.
multiFactor(user).enroll(multiFactorAssertion, "My personal phone number");


-Nohe

Atiol Beato

unread,
Feb 28, 2024, 4:43:24 PM2/28/24
to Firebase Google Group
Yes, it's react webapp and yes I am calling the above methods. 
\Again, this flow works flawlessly with all our company domains except when I try to register a user with from one particular domain.
I know that 2FA should not be related to any particular domain but I don't have an explanation for this kind of behavior at the moment.

Nohe .

unread,
Feb 28, 2024, 7:38:54 PM2/28/24
to fireba...@googlegroups.com
Under authorized domains in the Authentication settings, do you have that domain listed?

-Nohe

--
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/6YE_YsAoUQI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/80343ba4-96a1-4018-b594-906b7274a4fdn%40googlegroups.com.

Atiol Beato

unread,
Mar 25, 2024, 12:05:11 PM3/25/24
to Firebase Google Group
Yes please, its listed under authorized domains
Reply all
Reply to author
Forward
0 new messages