auth

auth(app) returns firebase.auth.Auth

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.

Parameter

app

Optional

firebase.app.App

Value must not be null.

Returns

non-null firebase.auth.Auth 

Examples

// 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);

Classes

Interfaces

Abstract types

AdditionalUserInfo

static

{providerId: string, profile: nullable Object, username: (nullable string or undefined)}

A structure containing additional user information from a federated identity provider.

UserCredential

static

{user: nullable firebase.User, credential: nullable firebase.auth.AuthCredential, operationType: (nullable string or undefined), additionalUserInfo: (nullable firebase.auth.AdditionalUserInfo or undefined)}

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.