Property

app

non-null admin.app.App

The app associated with the current Auth service instance.

Example

var app = auth.app;

Methods

createCustomToken

createCustomToken(uid, developerClaims) returns Promise containing string

Creates a new Firebase custom token (JWT) that can be sent back to a client device to use to sign in with the client SDKs' signInWithCustomToken() methods.

See Create Custom Tokens for code samples and detailed documentation.

Parameter

uid

string

The uid to use as the custom token's subject.

developerClaims

Optional

Object

Optional additional claims to include in the custom token's payload.

Value may be null.

Returns

non-null Promise containing string A promise fulfilled with a custom token for the provided uid and payload.

createUser

createUser(properties) returns Promise containing non-null admin.auth.UserRecord

Creates a new user.

See Create a user for code samples and detailed documentation.

Parameter

properties

Object

The properties to set on the new user record to be created.

Value must not be null.

Returns

non-null Promise containing non-null admin.auth.UserRecord A promise fulfilled with the user data corresponding to the newly created user.

deleteUser

deleteUser(uid) returns Promise containing void

Deletes an existing user.

See Delete a user for code samples and detailed documentation.

Parameter

uid

string

The uid corresponding to the user to delete.

Returns

non-null Promise containing void An empty promise fulfilled once the user has been deleted.

getUser

getUser(uid) returns Promise containing non-null admin.auth.UserRecord

Gets the user data for the user corresponding to a given uid.

See Retrieve user data for code samples and detailed documentation.

Parameter

uid

string

The uid corresponding to the user whose data to fetch.

Returns

non-null Promise containing non-null admin.auth.UserRecord A promise fulfilled with the user data corresponding to the provided uid.

getUserByEmail

getUserByEmail(email) returns Promise containing non-null admin.auth.UserRecord

Gets the user data for the user corresponding to a given email.

See Retrieve user data for code samples and detailed documentation.

Parameter

email

string

The email corresponding to the user whose data to fetch.

Returns

non-null Promise containing non-null admin.auth.UserRecord A promise fulfilled with the user data corresponding to the provided email.

updateUser

updateUser(uid, properties) returns Promise containing non-null admin.auth.UserRecord

Updates an existing user.

See Update a user for code samples and detailed documentation.

Parameter

uid

string

The uid corresponding to the user to delete.

properties

Object

The properties to update on the provided user.

Value must not be null.

Returns

non-null Promise containing non-null admin.auth.UserRecord A promise fulfilled with the updated user data.

verifyIdToken

verifyIdToken(idToken) returns Promise containing non-null admin.auth.DecodedIdToken

Verifies a Firebase ID token (JWT). If the token is valid, the promise is fulfilled with the token's decoded claims; otherwise, the promise is rejected.

See Verify ID Tokens for code samples and detailed documentation.

Parameter

idToken

string

The ID token to verify.

Returns

non-null Promise containing non-null admin.auth.DecodedIdToken A promise fulfilled with the token's decoded claims if the ID token is valid; otherwise, a rejected promise.