TOTPMultiFactorGenerator
@available(iOS 13, tvOS 13, macOS 10.15, watchOS 7, *)
@objc(FIRTOTPMultiFactorGenerator)
open class TOTPMultiFactorGenerator : NSObjectThe 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 and macOS.
-
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
Swift
@objc(generateSecretWithMultiFactorSession:completion:) open class func generateSecret(with session: MultiFactorSession, completion: @escaping (TOTPSecret?, Error?) -> Void)Parameters
sessionThe multiFactorSession instance.
completionCompletion block
-
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 correspondingto the user in the multiFactorSession.
Declaration
Swift
@available(iOS 13, tvOS 13, macOS 10.15, watchOS 7, *) open class func generateSecret(with session: MultiFactorSession) async throws -> TOTPSecretParameters
sessionThe multiFactorSession instance.
Return Value
The TOTP secret.
-
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
Swift
@objc(assertionForEnrollmentWithSecret:oneTimePassword:) open class func assertionForEnrollment(with secret: TOTPSecret, oneTimePassword: String) -> TOTPMultiFactorAssertionParameters
secretThe TOTP secret.
oneTimePasswordOne time password string.
Return Value
The MFA assertion.
-
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
Swift
@objc(assertionForSignInWithEnrollmentID:oneTimePassword:) open class func assertionForSignIn(withEnrollmentID enrollmentID: String, oneTimePassword: String) -> TOTPMultiFactorAssertionParameters
enrollmentIDThe ID that identifies the enrolled TOTP second factor.
oneTimePasswordone time password string.
Return Value
The MFA assertion.