-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[📚] Does this module support MFA with Firebase? #4166
Comments
MFA is a strategy, not an API. So, sure? You can do email/password (or social auth) and then also an SMS verification. That would be MFA, yes? |
Just a couple months ago an update was made to Firebase to support MFA via Google Cloud Identity. https://cloud.google.com/identity-platform/docs/web/mfa I doubt we support that though, so you'll have to improvise |
That is - I think - basically the SMS verification, which the native SDKs and react-native-firebase handle fine |
Is there a way to access the multifactor object within the native SDK from react-native-firebase module ? According to the documentation it's on the user object, without it, it's not possible to enroll an device as MFA |
You will have to instrument the code to inspect that object and log out contents to see, it likely does if you are on up to date SDKs I just read the doc more carefully and it looks like this is an API extension that needs wrapping here in order to expose it: https://cloud.google.com/identity-platform/docs/web/mfa#enrolling_a_second_factor Steps 9 Initialize a MultiFactorAssertion object with the PhoneAuthCredential: var multiFactorAssertion = firebase.auth.PhoneMultiFactorGenerator.assertion(cred); and 10 Complete the enrollment. Optionally, you can specify a display name for the second factor. This is useful for users with multiple second factors, since the phone number is masked during the authentication flow (for example, +1******1234). // Complete enrollment. This will update the underlying tokens
// and trigger ID token change listener.
user.multiFactor.enroll(multiFactorAssertion, 'My personal phone number'); It exists at least on android: https://firebase.google.com/docs/reference/android/com/google/firebase/auth/MultiFactor iOS it appears to be there as of pod version 6.20.0 https://firebase.google.com/support/release-notes/ios#version_6200_-_march_12_2020 PRs welcome! |
I'll see what I can do about doing a PR, thank you for your guidance! |
Hello 👋, to help manage issues we automatically close stale issues.
|
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Worth reopening I think - there is MFA information to expose on the user object I believe, an easy for PR for someone, similar to the #5019 PR |
Released in v11.3.0 here! |
Thanks @mikehardy, but if thats ok I need a clarification. |
I'm not clear on whether React Native Firebase supports TOTP for second factor. Can anyone clarify? |
@slapbox with apologies this isn't a use case of mine so I haven't explored it. I think this may be a "try it and see" 😬 - if it doesn't work, it can't be far off from working with all the multi-factor stuff in place now |
At least one of the necessary methods, The other required method, I wonder about the potential feasibility of adding that required method.
Edit: Added to list in #7483 |
Documentation Feedback
Firebase support MFA with any login type, I was wondering if this module supports it, its not in the documentation?
The text was updated successfully, but these errors were encountered: