react-native-firebase / auth/lib/modular
auth/lib/modular
ApplicationVerifier
Defined in: auth/lib/modular/index.d.ts:318
Interface representing an application verifier.
type
readonlytype:string
Defined in: auth/lib/modular/index.d.ts:319
verify()
verify():
Promise<string>
Defined in: auth/lib/modular/index.d.ts:320
PasswordValidationStatus
Defined in: auth/lib/modular/index.d.ts:753
A structure indicating which password policy requirements were met or violated and what the requirements are.
containsLowercaseLetter?
readonlyoptionalcontainsLowercaseLetter:boolean
Defined in: auth/lib/modular/index.d.ts:769
Whether the password contains a lowercase letter, or undefined if not required.
containsNonAlphanumericCharacter?
readonlyoptionalcontainsNonAlphanumericCharacter:boolean
Defined in: auth/lib/modular/index.d.ts:781
Whether the password contains a non-alphanumeric character, or undefined if not required.
containsNumericCharacter?
readonlyoptionalcontainsNumericCharacter:boolean
Defined in: auth/lib/modular/index.d.ts:777
Whether the password contains a numeric character, or undefined if not required.
containsUppercaseLetter?
readonlyoptionalcontainsUppercaseLetter:boolean
Defined in: auth/lib/modular/index.d.ts:773
Whether the password contains an uppercase letter, or undefined if not required.
isValid
readonlyisValid:boolean
Defined in: auth/lib/modular/index.d.ts:757
Whether the password meets all requirements.
meetsMaxPasswordLength?
readonlyoptionalmeetsMaxPasswordLength:boolean
Defined in: auth/lib/modular/index.d.ts:765
Whether the password meets the maximum password length, or undefined if not required.
meetsMinPasswordLength?
readonlyoptionalmeetsMinPasswordLength:boolean
Defined in: auth/lib/modular/index.d.ts:761
Whether the password meets the minimum password length, or undefined if not required.
passwordPolicy
readonlypasswordPolicy:PasswordPolicy
Defined in: auth/lib/modular/index.d.ts:785
The policy used to validate the password.
PopupRedirectResolver
Defined in: auth/lib/modular/index.d.ts:158
Persistence
Persistence =
object
Defined in: auth/lib/modular/index.d.ts:242
Type of Persistence.
- 'SESSION' is used for temporary persistence such as
sessionStorage. - 'LOCAL' is used for long term persistence such as
localStorageorIndexedDB. - 'NONE' is used for in-memory, or no persistence.
type
readonlytype:"SESSION"|"LOCAL"|"NONE"
Defined in: auth/lib/modular/index.d.ts:243
applyActionCode()
applyActionCode(
auth,oobCode):Promise<void>
Defined in: auth/lib/modular/index.d.ts:53
Applies a verification code sent to the user by email or other out-of-band mechanism.
beforeAuthStateChanged()
beforeAuthStateChanged(
auth,callback,onAbort?):void
Defined in: auth/lib/modular/index.d.ts:63
Adds a blocking callback that runs before an auth state change sets a new user.
checkActionCode()
checkActionCode(
auth,oobCode):Promise<ActionCodeInfo>
Defined in: auth/lib/modular/index.d.ts:76
Checks a verification code sent to the user by email or other out-of-band mechanism.
confirmPasswordReset()
confirmPasswordReset(
auth,oobCode,newPassword):Promise<void>
Defined in: auth/lib/modular/index.d.ts:89
Completes the password reset process, given a confirmation code and new password.
connectAuthEmulator()
connectAuthEmulator(
auth,url,options?):void
Defined in: auth/lib/modular/index.d.ts:104
Changes the Auth instance to communicate with the Firebase Auth Emulator, instead of production Firebase Auth services.
options?
Optional. Options for the emulator connection.
This must be called synchronously immediately following the first call to initializeAuth(). Do not use with production credentials as emulator traffic is not encrypted.
createUserWithEmailAndPassword()
createUserWithEmailAndPassword(
auth,password):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:118
Creates a new user account associated with the specified email address and password.
deleteUser()
deleteUser(
user):Promise<void>
Defined in: auth/lib/modular/index.d.ts:463
Deletes and signs out the user.
fetchSignInMethodsForEmail()
fetchSignInMethodsForEmail(
auth,Promise<string[]>
Defined in: auth/lib/modular/index.d.ts:131
Gets the list of possible sign in methods for the given email address.
getAdditionalUserInfo()
getAdditionalUserInfo(
userCredential):AdditionalUserInfo|null
Defined in: auth/lib/modular/index.d.ts:696
Extracts provider specific AdditionalUserInfo for the given credential.
getAuth()
getAuth(
app?):Module
Defined in: auth/lib/modular/index.d.ts:30
Returns the Auth instance associated with the provided FirebaseApp.
getCustomAuthDomain()
getCustomAuthDomain(
auth):Promise<string>
Defined in: auth/lib/modular/index.d.ts:706
Returns the custom auth domain for the auth instance.
getIdToken()
getIdToken(
user,forceRefresh?):Promise<string>
Defined in: auth/lib/modular/index.d.ts:472
Returns a JSON Web Token (JWT) used to identify the user to a Firebase service.
getIdTokenResult()
getIdTokenResult(
user,forceRefresh?):Promise<IdTokenResult>
Defined in: auth/lib/modular/index.d.ts:481
Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service.
getMultiFactorResolver()
getMultiFactorResolver(
auth,error):MultiFactorResolver
Defined in: auth/lib/modular/index.d.ts:140
Provides a MultiFactorResolver suitable for completion of a multi-factor flow.
getRedirectResult()
getRedirectResult(
auth,resolver?):Promise<UserCredential|null>
Defined in: auth/lib/modular/index.d.ts:152
Returns a UserCredential from the redirect-based sign-in flow.
initializeAuth()
initializeAuth(
app,deps?):Module
Defined in: auth/lib/modular/index.d.ts:44
This function allows more control over the Auth instance than getAuth().
Returns
Module
The Auth instance.
getAuth uses platform-specific defaults to supply the Dependencies. In general, getAuth is the easiest way to initialize Auth and works for most use cases. Use initializeAuth if you need control over which persistence layer is used, or to minimize bundle size if you're not using either signInWithPopup or signInWithRedirect.
initializeRecaptchaConfig()
initializeRecaptchaConfig(
auth):Promise<void>
Defined in: auth/lib/modular/index.d.ts:165
Loads the reCAPTCHA configuration into the Auth instance. Does not work in a Node.js environment
isSignInWithEmailLink()
isSignInWithEmailLink(
auth,emailLink):Promise<boolean>
Defined in: auth/lib/modular/index.d.ts:175
Checks if an incoming link is a sign-in with email link suitable for signInWithEmailLink.
Note that android and other platforms require apiKey link parameter for signInWithEmailLink
linkWithCredential()
linkWithCredential(
user,credential):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:493
Links the user account with the given credentials.
linkWithPhoneNumber()
linkWithPhoneNumber(
user,phoneNumber,appVerifier?):Promise<ConfirmationResult>
Defined in: auth/lib/modular/index.d.ts:506
Links the user account with the given phone number.
linkWithPopup()
linkWithPopup(
user,provider,resolver?):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:520
Links the authenticated provider to the user account using a pop-up based OAuth flow.
linkWithRedirect()
linkWithRedirect(
user,provider,resolver?):Promise<void>
Defined in: auth/lib/modular/index.d.ts:534
Links the OAuthProvider to the user account using a full-page redirect flow.
multiFactor()
multiFactor(
user):MultiFactorUser
Defined in: auth/lib/modular/index.d.ts:546
The MultiFactorUser corresponding to the user.
onAuthStateChanged()
onAuthStateChanged(
auth,nextOrObserver): () =>void
Defined in: auth/lib/modular/index.d.ts:184
Adds an observer for changes to the user's sign-in state.
nextOrObserver
CallbackOrObserver<AuthListenerCallback>
A callback function or observer for auth state changes.
onIdTokenChanged()
onIdTokenChanged(
auth,nextOrObserver): () =>void
Defined in: auth/lib/modular/index.d.ts:196
Adds an observer for changes to the signed-in user's ID token.
nextOrObserver
CallbackOrObserver<AuthListenerCallback>
A callback function or observer for ID token changes.
parseActionCodeURL()
parseActionCodeURL(
link):any
Defined in: auth/lib/modular/index.d.ts:455
Parses the email action link string and returns an ActionCodeURL if the link is valid, otherwise returns null.
reauthenticateWithCredential()
reauthenticateWithCredential(
user,credential):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:555
Re-authenticates a user using a fresh credential.
reauthenticateWithPhoneNumber()
reauthenticateWithPhoneNumber(
user,phoneNumber,appVerifier?):Promise<ConfirmationResult>
Defined in: auth/lib/modular/index.d.ts:568
Re-authenticates a user using a fresh phone credential.
reauthenticateWithPopup()
reauthenticateWithPopup(
user,provider,resolver?):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:582
Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
reauthenticateWithRedirect()
reauthenticateWithRedirect(
user,provider,resolver?):Promise<void>
Defined in: auth/lib/modular/index.d.ts:596
Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
reload()
reload(
user):Promise<void>
Defined in: auth/lib/modular/index.d.ts:608
Reloads user account data, if signed in.
revokeAccessToken()
revokeAccessToken(
auth,token):Promise<void>
Defined in: auth/lib/modular/index.d.ts:206
Revoke the given access token, Currently only supports Apple OAuth access tokens.
sendEmailVerification()
sendEmailVerification(
user,actionCodeSettings?):Promise<void>
Defined in: auth/lib/modular/index.d.ts:617
Sends a verification email to a user.
sendPasswordResetEmail()
sendPasswordResetEmail(
auth,actionCodeSettings?):Promise<void>
Defined in: auth/lib/modular/index.d.ts:216
Sends a password reset email to the given email address.
sendSignInLinkToEmail()
sendSignInLinkToEmail(
auth,actionCodeSettings?):Promise<void>
Defined in: auth/lib/modular/index.d.ts:230
Sends a sign-in email link to the user with the specified email.
setLanguageCode()
setLanguageCode(
auth,languageCode):Promise<void>
Defined in: auth/lib/modular/index.d.ts:420
Sets the language code.
languageCode
An ISO language code. 'null' value will set the language code to the app's current language.
string | null
setPersistence()
setPersistence(
auth,persistence):Promise<void>
Defined in: auth/lib/modular/index.d.ts:253
Changes the type of persistence on the Auth instance for the currently saved Auth session and applies this type of persistence for future sign-in requests, including sign-in with redirect requests.
signInAnonymously()
signInAnonymously(
auth):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:261
Asynchronously signs in as an anonymous user.
signInWithCredential()
signInWithCredential(
auth,credential):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:270
Asynchronously signs in with the given credentials.
signInWithCustomToken()
signInWithCustomToken(
auth,customToken):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:282
Asynchronously signs in using a custom token.
signInWithEmailAndPassword()
signInWithEmailAndPassword(
auth,password):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:295
Asynchronously signs in using an email and password.
signInWithEmailLink()
signInWithEmailLink(
auth,emailLink):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:309
Asynchronously signs in using an email and sign-in email link.
signInWithPhoneNumber()
signInWithPhoneNumber(
auth,phoneNumber,appVerifier?,forceResend?):Promise<ConfirmationResult>
Defined in: auth/lib/modular/index.d.ts:332
Asynchronously signs in using a phone number.
forceResend?
boolean
Optional. (Native only) Forces a new message to be sent if it was already recently sent.
signInWithPopup()
signInWithPopup(
auth,provider,resolver?):Promise<UserCredential>
Defined in: auth/lib/modular/index.d.ts:363
Authenticates a Firebase client using a popup-based OAuth authentication flow.
signInWithRedirect()
signInWithRedirect(
auth,provider,resolver?):Promise<never>
Defined in: auth/lib/modular/index.d.ts:377
Authenticates a Firebase client using a full-page redirect flow.
signOut()
signOut(
auth):Promise<void>
Defined in: auth/lib/modular/index.d.ts:389
Signs out the current user.
unlink()
unlink(
user,providerId):Promise<User>
Defined in: auth/lib/modular/index.d.ts:629
Unlinks a provider from a user account.
updateCurrentUser()
updateCurrentUser(
auth,user):Promise<void>
Defined in: auth/lib/modular/index.d.ts:398
Asynchronously sets the provided user as Auth.currentUser on the Auth instance.
updateEmail()
updateEmail(
user,newEmail):Promise<void>
Defined in: auth/lib/modular/index.d.ts:641
Updates the user's email address.
updatePassword()
updatePassword(
user,newPassword):Promise<void>
Defined in: auth/lib/modular/index.d.ts:650
Updates the user's password.
updatePhoneNumber()
updatePhoneNumber(
user,credential):Promise<void>
Defined in: auth/lib/modular/index.d.ts:659
Updates the user's phone number.
updateProfile()
updateProfile(
user,profile):Promise<void>
Defined in: auth/lib/modular/index.d.ts:671
Updates a user's profile data.
useDeviceLanguage()
useDeviceLanguage(
auth):void
Defined in: auth/lib/modular/index.d.ts:405
Sets the current language to the default device/browser preference.
useUserAccessGroup()
useUserAccessGroup(
auth,userAccessGroup):Promise<void>
Defined in: auth/lib/modular/index.d.ts:438
Configures a shared user access group to sync auth state across multiple apps via the Keychain.
Call Signature
validatePassword(
auth,password):Promise<PasswordValidationStatus>
Defined in: auth/lib/modular/index.d.ts:429
Validates the password against the password policy configured for the project or tenant.
Returns
Promise<PasswordValidationStatus>
Call Signature
validatePassword(
auth,password):Promise<PasswordValidationStatus>
Defined in: auth/lib/modular/index.d.ts:745
Validates the password against the password policy configured for the project or tenant.
Returns
Promise<PasswordValidationStatus>
Remarks
If no tenant ID is set on the Auth instance, then this method will use the password
policy configured for the project. Otherwise, this method will use the policy configured
for the tenant. If a password policy has not been configured, then the default policy
configured for all projects will be used.
If an auth flow fails because a submitted password does not meet the password policy requirements and this method has previously been called, then this method will use the most recent policy available when called again.
When using this method, ensure you have the Identity Toolkit enabled on the Google Cloud Platform with the API Key for your application permitted to use it.
Example
import { getAuth, validatePassword } from "firebase/auth";
const status = await validatePassword(getAuth(), passwordFromUser);
if (!status.isValid) {
// Password could not be validated. Use the status to show what
// requirements are met and which are missing.
// If a criterion is undefined, it is not required by policy. If the
// criterion is defined but false, it is required but not fulfilled by
// the given password. For example:
const needsLowerCase = status.containsLowercaseLetter !== true;
}
verifyBeforeUpdateEmail()
verifyBeforeUpdateEmail(
user,newEmail,actionCodeSettings?):Promise<void>
Defined in: auth/lib/modular/index.d.ts:684
Sends a verification email to a new email address.
verifyPasswordResetCode()
verifyPasswordResetCode(
auth,code):Promise<string>
Defined in: auth/lib/modular/index.d.ts:447
Verifies the password reset code sent to the user by email or other out-of-band mechanism.
verifyPhoneNumber()
verifyPhoneNumber(
auth,phoneNumber,autoVerifyTimeoutOrForceResend,forceResend?):PhoneAuthListener
Defined in: auth/lib/modular/index.d.ts:348
Asynchronously signs in using a phone number.
EmailAuthProvider
Renames and re-exports AppleAuthProvider
FacebookAuthProvider
Renames and re-exports AppleAuthProvider
GithubAuthProvider
Renames and re-exports AppleAuthProvider
GoogleAuthProvider
Renames and re-exports AppleAuthProvider
OAuthProvider
Renames and re-exports AppleAuthProvider
OIDCAuthProvider
Renames and re-exports AppleAuthProvider
PhoneAuthProvider
Renames and re-exports AppleAuthProvider
PhoneAuthState
Renames and re-exports AppleAuthProvider
PhoneMultiFactorGenerator
Renames and re-exports AppleAuthProvider
TotpMultiFactorGenerator
Renames and re-exports AppleAuthProvider
TotpSecret
Renames and re-exports AppleAuthProvider
TwitterAuthProvider
Renames and re-exports AppleAuthProvider
