Gets the Auth service for the default app or a
given app.
firebase.auth() can be called with no arguments to access the default app's
Auth service or as firebase.auth(app) to
access the Auth service associated with a
specific app.
example
// Get the Auth service for the default appvar defaultAuth = firebase.auth();
example
// Get the Auth service for a given appvar otherAuth = firebase.auth(otherApp);
This is the interface that defines the required continue/state URL with
optional Android and iOS bundle identifiers.
The action code setting fields are:
url: Sets the link continue/state URL, which has different meanings
in different contexts:
When the link is handled in the web action widgets, this is the deep
link in the continueUrl query parameter.
When the link is handled in the app directly, this is the continueUrl
query parameter in the deep link of the Dynamic Link.
iOS: Sets the iOS bundle ID. This will try to open the link in an iOS app
if it is installed.
android: Sets the Android package name. This will try to open the link in
an android app if it is installed. If installApp is passed, it specifies
whether to install the Android app if the device supports it and the app
is not already installed. If this field is provided without a
packageName, an error is thrown explaining that the packageName must be
provided in conjunction with this field.
If minimumVersion is specified, and an older version of the app is
installed, the user is taken to the Play Store to upgrade the app.
handleCodeInApp: The default is false. When set to true, the action code
link will be be sent as a Universal Link or Android App Link and will be
opened by the app if installed. In the false case, the code will be sent
to the web widget first and then on continue will redirect to the app if
installed.
The information required to verify the ownership of a phone number. The
information that's required depends on whether you are doing single-factor
sign-in, multi-factor enrollment or multi-factor sign-in.
A structure containing a User, an AuthCredential, the operationType, and
any additional user information that was returned from the identity provider.
operationType could be 'signIn' for a sign-in operation, 'link' for a linking
operation and 'reauthenticate' for a reauthentication operation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-07-27 UTC."],[],[],null,["# auth | JavaScript SDK\n\n- [firebase](/docs/reference/js/v8/firebase).\n- auth\n====================================================\n\n### Callable\n\n- auth ( app ? : [App](/docs/reference/js/v8/firebase.app.App) ) : [Auth](/docs/reference/js/v8/firebase.auth.Auth)\n- Gets the [`Auth`](/docs/reference/js/v8/firebase.auth.Auth) service for the default app or a\n given app.\n\n `firebase.auth()` can be called with no arguments to access the default app's\n [`Auth`](/docs/reference/js/v8/firebase.auth.Auth) service or as `firebase.auth(app)` to\n access the [`Auth`](/docs/reference/js/v8/firebase.auth.Auth) service associated with a\n specific app.\n\n example\n :\n\n\n // Get the Auth service for the default app\n var defaultAuth = firebase.auth();\n\n\n example\n :\n\n\n // Get the Auth service for a given app\n var otherAuth = firebase.auth(otherApp);\n\n\n #### Parameters\n\n -\n\n ##### Optional app: [App](/docs/reference/js/v8/firebase.app.App)\n\n #### Returns [Auth](/docs/reference/js/v8/firebase.auth.Auth)\n\nIndex\n-----\n\n### Modules\n\n- [ActionCodeInfo](/docs/reference/js/v8/firebase.auth.ActionCodeInfo)\n- [Auth](/docs/reference/js/v8/firebase.auth.Auth)\n\n### Classes\n\n- [ActionCodeURL](/docs/reference/js/v8/firebase.auth.ActionCodeURL)\n- [AuthCredential](/docs/reference/js/v8/firebase.auth.AuthCredential)\n- [EmailAuthProvider](/docs/reference/js/v8/firebase.auth.EmailAuthProvider)\n- [FacebookAuthProvider](/docs/reference/js/v8/firebase.auth.FacebookAuthProvider)\n- [GithubAuthProvider](/docs/reference/js/v8/firebase.auth.GithubAuthProvider)\n- [GoogleAuthProvider](/docs/reference/js/v8/firebase.auth.GoogleAuthProvider)\n- [MultiFactorAssertion](/docs/reference/js/v8/firebase.auth.MultiFactorAssertion)\n- [MultiFactorResolver](/docs/reference/js/v8/firebase.auth.MultiFactorResolver)\n- [MultiFactorSession](/docs/reference/js/v8/firebase.auth.MultiFactorSession)\n- [OAuthCredential](/docs/reference/js/v8/firebase.auth.OAuthCredential)\n- [OAuthProvider](/docs/reference/js/v8/firebase.auth.OAuthProvider)\n- [PhoneAuthCredential](/docs/reference/js/v8/firebase.auth.PhoneAuthCredential)\n- [PhoneAuthProvider](/docs/reference/js/v8/firebase.auth.PhoneAuthProvider)\n- [PhoneMultiFactorAssertion](/docs/reference/js/v8/firebase.auth.PhoneMultiFactorAssertion)\n- [PhoneMultiFactorGenerator](/docs/reference/js/v8/firebase.auth.PhoneMultiFactorGenerator)\n- [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier)\n- [SAMLAuthProvider](/docs/reference/js/v8/firebase.auth.SAMLAuthProvider)\n- [TwitterAuthProvider](/docs/reference/js/v8/firebase.auth.TwitterAuthProvider)\n\n### Interfaces\n\n- [ApplicationVerifier](/docs/reference/js/v8/firebase.auth.ApplicationVerifier)\n- [AuthError](/docs/reference/js/v8/firebase.auth.AuthError)\n- [AuthProvider](/docs/reference/js/v8/firebase.auth.AuthProvider)\n- [AuthSettings](/docs/reference/js/v8/firebase.auth.AuthSettings)\n- [Config](/docs/reference/js/v8/firebase.auth.Config)\n- [ConfirmationResult](/docs/reference/js/v8/firebase.auth.ConfirmationResult)\n- [EmulatorConfig](/docs/reference/js/v8/firebase.auth.EmulatorConfig)\n- [Error](/docs/reference/js/v8/firebase.auth.Error)\n- [IdTokenResult](/docs/reference/js/v8/firebase.auth.IDTokenResult)\n- [MultiFactorError](/docs/reference/js/v8/firebase.auth.MultiFactorError)\n- [MultiFactorInfo](/docs/reference/js/v8/firebase.auth.MultiFactorInfo)\n- [OAuthCredentialOptions](/docs/reference/js/v8/firebase.auth.OAuthCredentialOptions)\n- [PhoneMultiFactorEnrollInfoOptions](/docs/reference/js/v8/firebase.auth.PhoneMultiFactorEnrollInfoOptions)\n- [PhoneMultiFactorInfo](/docs/reference/js/v8/firebase.auth.PhoneMultiFactorInfo)\n- [PhoneMultiFactorSignInInfoOptions](/docs/reference/js/v8/firebase.auth.PhoneMultiFactorSignInInfoOptions)\n- [PhoneSingleFactorInfoOptions](/docs/reference/js/v8/firebase.auth.PhoneSingleFactorInfoOptions)\n- [UserMetadata](/docs/reference/js/v8/firebase.auth.UserMetadata)\n\n### Type aliases\n\n- [ActionCodeSettings](/docs/reference/js/v8/firebase.auth#actioncodesettings)\n- [AdditionalUserInfo](/docs/reference/js/v8/firebase.auth#additionaluserinfo)\n- [PhoneInfoOptions](/docs/reference/js/v8/firebase.auth#phoneinfooptions)\n- [UserCredential](/docs/reference/js/v8/firebase.auth#usercredential)\n\nType aliases\n------------\n\n### ActionCodeSettings\n\nActionCodeSettings: { android?: { installApp?: boolean; minimumVersion?: string; packageName: string }; dynamicLinkDomain?: string; handleCodeInApp?: boolean; iOS?: { bundleId: string }; url: string } \nThis is the interface that defines the required continue/state URL with\noptional Android and iOS bundle identifiers.\nThe action code setting fields are:\n\n- url: Sets the link continue/state URL, which has different meanings\n in different contexts:\n\n - When the link is handled in the web action widgets, this is the deep link in the continueUrl query parameter.\n - When the link is handled in the app directly, this is the continueUrl query parameter in the deep link of the Dynamic Link.\n- iOS: Sets the iOS bundle ID. This will try to open the link in an iOS app if it is installed.\n- android: Sets the Android package name. This will try to open the link in an android app if it is installed. If installApp is passed, it specifies whether to install the Android app if the device supports it and the app is not already installed. If this field is provided without a packageName, an error is thrown explaining that the packageName must be provided in conjunction with this field. If minimumVersion is specified, and an older version of the app is installed, the user is taken to the Play Store to upgrade the app.\n- handleCodeInApp: The default is false. When set to true, the action code link will be be sent as a Universal Link or Android App Link and will be opened by the app if installed. In the false case, the code will be sent to the web widget first and then on continue will redirect to the app if installed. \n\n#### Type declaration\n\n-\n\n ##### Optional android?: { installApp?: boolean; minimumVersion?: string; packageName: string }\n\n -\n\n ##### Optional installApp?: boolean\n\n -\n\n ##### Optional minimumVersion?: string\n\n -\n\n ##### packageName: string\n\n-\n\n ##### Optional dynamicLinkDomain?: string\n\n-\n\n ##### Optional handleCodeInApp?: boolean\n\n-\n\n ##### Optional iOS?: { bundleId: string }\n\n -\n\n ##### bundleId: string\n\n-\n\n ##### url: string\n\n### AdditionalUserInfo\n\nAdditionalUserInfo: { isNewUser: boolean; profile: Object \\| null; providerId: string; username?: string \\| null } \nA structure containing additional user information from a federated identity\nprovider. \n\n#### Type declaration\n\n-\n\n ##### isNewUser: boolean\n\n-\n\n ##### profile: Object \\| null\n\n-\n\n ##### providerId: string\n\n-\n\n ##### Optional username?: string \\| null\n\n### PhoneInfoOptions\n\nPhoneInfoOptions: [PhoneSingleFactorInfoOptions](/docs/reference/js/v8/firebase.auth.PhoneSingleFactorInfoOptions) \\| [PhoneMultiFactorEnrollInfoOptions](/docs/reference/js/v8/firebase.auth.PhoneMultiFactorEnrollInfoOptions) \\| [PhoneMultiFactorSignInInfoOptions](/docs/reference/js/v8/firebase.auth.PhoneMultiFactorSignInInfoOptions) \nThe information required to verify the ownership of a phone number. The\ninformation that's required depends on whether you are doing single-factor\nsign-in, multi-factor enrollment or multi-factor sign-in.\n\n### UserCredential\n\nUserCredential: { additionalUserInfo?: [AdditionalUserInfo](/docs/reference/js/v8/firebase.auth#additionaluserinfo) \\| null; credential: [AuthCredential](/docs/reference/js/v8/firebase.auth.AuthCredential) \\| null; operationType?: string \\| null; user: [User](/docs/reference/js/v8/firebase.User) \\| null } \nA structure containing a User, an AuthCredential, the operationType, and\nany additional user information that was returned from the identity provider.\noperationType could be 'signIn' for a sign-in operation, 'link' for a linking\noperation and 'reauthenticate' for a reauthentication operation. \n\n#### Type declaration\n\n-\n\n ##### Optional additionalUserInfo?: [AdditionalUserInfo](/docs/reference/js/v8/firebase.auth#additionaluserinfo) \\| null\n\n-\n\n ##### credential: [AuthCredential](/docs/reference/js/v8/firebase.auth.AuthCredential) \\| null\n\n-\n\n ##### Optional operationType?: string \\| null\n\n-\n\n ##### user: [User](/docs/reference/js/v8/firebase.User) \\| null"]]
Gets the
Auth
service for the default app or a given app.firebase.auth()
can be called with no arguments to access the default app'sAuth
service or asfirebase.auth(app)
to access theAuth
service associated with a specific app.// Get the Auth service for the default app var defaultAuth = firebase.auth();
// Get the Auth service for a given app var otherAuth = firebase.auth(otherApp);