FirebaseAuthSettings

abstract classFirebaseAuthSettings


Enables the configuration of FirebaseAuth related settings.

Summary

Public constructors

Public functions

abstractUnit

Forces application verification to use the web reCAPTCHA flow for Phone Authentication.

abstractUnit

Disables application verification flows for Phone Authentication and Phone Multi-Factor flows.

abstractUnit
setAutoRetrievedSmsCodeForPhoneNumber(
    phoneNumber: String?,
    smsCode: String?
)

The phone number and SMS code here must have been configured in the Firebase Console (Authentication >Sign In Method >Phone).

Public constructors

FirebaseAuthSettings

FirebaseAuthSettings()

Public functions

forceRecaptchaFlowForTesting

abstract fun forceRecaptchaFlowForTesting(forceRecaptchaFlow: Boolean): Unit

Forces application verification to use the web reCAPTCHA flow for Phone Authentication.

Once this has been called, every call toverifyPhoneNumber will skip the Play Integrity API verification flow and use the reCAPTCHA flow instead.

Calling this method a second time will overwrite the previously passed parameter.

Parameters
forceRecaptchaFlow: Boolean

whether to only use the reCAPTCHA-based verification flow.

setAppVerificationDisabledForTesting

abstract fun setAppVerificationDisabledForTesting(setVerificationDisabled: Boolean): Unit

Disables application verification flows for Phone Authentication and Phone Multi-Factor flows. Intended for use with the phone numbers configured in the Firebase Console for testing (Authentication >Sign In Method >Phone), or with the Firebase Auth emulator.

Once this has been called, every call toverifyPhoneNumber will skip the Play Integrity API and reCAPTCHA verification flows.

Calling this method a second time will overwrite the previously passed parameter.

Parameters
setVerificationDisabled: Boolean

whether to disable application verification for phone flows.

setAutoRetrievedSmsCodeForPhoneNumber

abstract fun setAutoRetrievedSmsCodeForPhoneNumber(
    phoneNumber: String?,
    smsCode: String?
): Unit

The phone number and SMS code here must have been configured in the Firebase Console (Authentication >Sign In Method >Phone).

Once this has been called, every call toverifyPhoneNumber with the same phone number as the one that is configured here will haveonVerificationCompleted triggered as the callback.

Calling this method a second time will overwrite the previously passed parameters. Only one number can be configured at a given time.

Calling this method with either parameter set to null removes this functionality until valid parameters are passed.

Verifying a phone number other than the one configured here will trigger normal behaviour. If the phone number is configured as a test phone number in the console, the regular testing flow occurs. Otherwise, normal phone number verification will take place.

When this is set andverifyPhoneNumber is called with a matching phone number,onCodeAutoRetrievalTimeOut will never be called.

Parameters
phoneNumber: String?

A phone number that has been configured in the Firebase Console that conforms to the E.164 format.

smsCode: String?

An SMS code that has been configured in the Firebase Console.

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-07-21 UTC.