Callable

  • auth(app?: App):Auth
  • Gets theAuth service for the default app or agiven app.

    firebase.auth() can be called with no arguments to access the default app'sAuth service or asfirebase.auth(app) toaccess theAuth service associated with aspecific 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);

    Parameters

    • Optional app:App

    ReturnsAuth

Index

Type aliases

ActionCodeSettings

ActionCodeSettings:{android?:{installApp?:boolean;minimumVersion?:string;packageName:string };dynamicLinkDomain?:string;handleCodeInApp?:boolean;iOS?:{bundleId:string };url:string }

This is the interface that defines the required continue/state URL withoptional Android and iOS bundle identifiers.The action code setting fields are:

  • url: Sets the link continue/state URL, which has different meaningsin different contexts:

    • When the link is handled in the web action widgets, this is the deeplink in the continueUrl query parameter.
    • When the link is handled in the app directly, this is the continueUrlquery 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 appif it is installed.
  • android: Sets the Android package name. This will try to open the link inan android app if it is installed. If installApp is passed, it specifieswhether to install the Android app if the device supports it and the appis not already installed. If this field is provided without apackageName, an error is thrown explaining that the packageName must beprovided in conjunction with this field.If minimumVersion is specified, and an older version of the app isinstalled, the user is taken to the Play Store to upgrade the app.
  • handleCodeInApp: The default is false. When set to true, the action codelink will be be sent as a Universal Link or Android App Link and will beopened by the app if installed. In the false case, the code will be sentto the web widget first and then on continue will redirect to the app ifinstalled.

Type declaration

  • Optional android?:{installApp?:boolean;minimumVersion?:string;packageName:string }
    • Optional installApp?:boolean
    • Optional minimumVersion?:string
    • packageName:string
  • Optional dynamicLinkDomain?:string
  • Optional handleCodeInApp?:boolean
  • Optional iOS?:{bundleId:string }
    • bundleId:string
  • url:string

AdditionalUserInfo

AdditionalUserInfo:{isNewUser:boolean;profile:Object |null;providerId:string;username?:string |null }

A structure containing additional user information from a federated identityprovider.

Type declaration

  • isNewUser:boolean
  • profile:Object |null
  • providerId:string
  • Optional username?:string |null

PhoneInfoOptions

The information required to verify the ownership of a phone number. Theinformation that's required depends on whether you are doing single-factorsign-in, multi-factor enrollment or multi-factor sign-in.

UserCredential

UserCredential:{additionalUserInfo?:AdditionalUserInfo |null;credential:AuthCredential |null;operationType?:string |null;user:User |null }

A structure containing a User, an AuthCredential, the operationType, andany additional user information that was returned from the identity provider.operationType could be 'signIn' for a sign-in operation, 'link' for a linkingoperation and 'reauthenticate' for a reauthentication operation.

Type declaration

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 2022-07-27 UTC.