FirebaseAuth Framework Reference

FIRTOTPMultiFactorGenerator


@interface FIRTOTPMultiFactorGenerator : NSObject

The data structure used to help initialize an assertion for a second factor entity to the Firebase Auth/CICP server. Depending on the type of second factor, this will help generate the assertion. This class is available on iOS only.

  • Creates a TOTP secret as part of enrolling a TOTP second factor. Used for generating a QR code URL or inputting into a TOTP app. This method uses the auth instance corresponding to the user in the multiFactorSession.

    Declaration

    Objective-C

    + (void)generateSecretWithMultiFactorSession:
                (nonnull FIRMultiFactorSession *)session
                                      completion:(nonnull void (^)(
                                                     FIRTOTPSecret *_Nullable,
                                                     NSError *_Nullable))completion;

    Parameters

    session

    The multiFactorSession instance.

    completion

    Completion block

  • Initializes the MFA assertion to confirm ownership of the TOTP second factor. This assertion is used to complete enrollment of TOTP as a second factor.

    Declaration

    Objective-C

    + (nonnull FIRTOTPMultiFactorAssertion *)
        assertionForEnrollmentWithSecret:(nonnull FIRTOTPSecret *)secret
                         oneTimePassword:(nonnull NSString *)oneTimePassword;

    Parameters

    secret

    The TOTP secret.

    oneTimePassword

    one time password string.

  • Initializes the MFA assertion to confirm ownership of the TOTP second factor. This assertion is used to complete signIn with TOTP as a second factor.

    Declaration

    Objective-C

    + (nonnull FIRTOTPMultiFactorAssertion *)
        assertionForSignInWithEnrollmentID:(nonnull NSString *)enrollmentID
                           oneTimePassword:(nonnull NSString *)oneTimePassword;

    Parameters

    enrollmentID

    The ID that identifies the enrolled TOTP second factor.

    oneTimePassword

    one time password string.