Skip to content
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

Enable Multifactor authentication #714

Closed
doginthehat opened this issue Feb 28, 2022 · 1 comment
Closed

Enable Multifactor authentication #714

doginthehat opened this issue Feb 28, 2022 · 1 comment
Labels
Authentication Related to Firebase Auth feature request New feature request

Comments

@doginthehat
Copy link

Feature request

Firebase (through Google Identity Platform) supports Multifactor authentication or 2fa.

Currently only phone is available as a second factor.

The native Firebase SDKs support these method but FirebaseX currently doesn't expose the SDK methods required.

Here's an example for iOS SDK https://cloud.google.com/identity-platform/docs/ios/mfa#objective-c_2

To enable that, FirebaseX would need to expose more native Firebase functions to the JS bridge

The pattern for enrollement is:

  1. Start a MFa session
  2. Send number verification request, get a verificationID back
  3. Request code input from user
  4. Match code with verificationID
  5. Enroll

For example, on iOS we would need those:

- (void)getSessionWithCompletion:(nullable void (^)(FIRMultiFactorSession *_Nullable credential,
                                                    NSError *_Nullable error))completion;

- (void)verifyPhoneNumber:(NSString *)phoneNumber
               UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
       multiFactorSession:(nullable FIRMultiFactorSession *)session
               completion:(nullable FIRVerificationResultCallback)completion;

- (FIRPhoneAuthCredential *)credentialWithVerificationID:(NSString *)verificationID
                                        verificationCode:(NSString *)verificationCode;

FIRMultiFactorAssertion *assertion = [FIRPhoneMultiFactorGenerator assertionWithCredential:credential];


- (void)enrollWithAssertion:(FIRMultiFactorAssertion *)assertion
                displayName:(nullable NSString *)displayName
                 completion:(nullable void (^)(NSError *_Nullable error))completion;


I haven't looked into Android SDK but would be similar pattern/apis.

Thank you 🙏

@dpa99c dpa99c added feature request New feature request Authentication Related to Firebase Auth labels Oct 31, 2022
dpa99c added a commit that referenced this issue Nov 7, 2022
@dpa99c
Copy link
Owner

dpa99c commented Dec 6, 2022

Implemented in v16.0.0

@dpa99c dpa99c closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authentication Related to Firebase Auth feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants