FirebaseAuth Framework Reference

TOTPSecret

@objc(FIRTOTPSecret)openclassTOTPSecret:NSObject

The subclass of base class MultiFactorAssertion, used to assert ownership of a TOTP(Time-based One Time Password) second factor.

This class is available on iOS and macOS.

  • Returns the shared secret key/seed used to generate time-based one-time passwords.

    Declaration

    Swift

    @objcopenfuncsharedSecretKey()->String
  • Returns a QRCode URL as described inhttps://github.com/google/google-authenticator/wiki/Key-Uri-Format.

    This can be displayed to the user as a QRCode to be scanned into a TOTP app like GoogleAuthenticator.

    Declaration

    Swift

    @objc(generateQRCodeURLWithAccountName:issuer:)openfuncgenerateQRCodeURL(withAccountNameaccountName:String,issuer:String)->String

    Parameters

    accountName

    The name of the account/app.

    issuer

    Issuer of the TOTP(likely the app name).

    Return Value

    A QRCode URL string.

  • Opens the specified QR Code URL in a password manager like iCloud Keychain.

    See more detailshere

    Declaration

    Swift

    @MainActor@objc(openInOTPAppWithQRCodeURL:)openfuncopenInOTPApp(withQRCodeURLqrCodeURL:String)

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-27 UTC.