admin.auth. Auth
The Firebase Auth service interface.
Do not call this constructor directly. Instead, use
admin.auth().
See Introduction to the Admin Auth API for a full guide on how to use the Firebase Auth service.
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 |
|
developerClaims |
Optional Object Optional additional claims to include in the custom token's payload. Value may be null. |
- Returns
-
non-null Promise containing stringA promise fulfilled with a custom token for the provideduidand 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.UserRecordA 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 |
- Returns
-
non-null Promise containing voidAn 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 |
- Returns
-
non-null Promise containing non-null admin.auth.UserRecordA promise fulfilled with the user data corresponding to the provideduid.
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 |
|
|---|---|
|
|
string The email corresponding to the user whose data to fetch. |
- Returns
-
non-null Promise containing non-null admin.auth.UserRecordA 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 |
|
properties |
Object The properties to update on the provided user. Value must not be null. |
- Returns
-
non-null Promise containing non-null admin.auth.UserRecordA promise fulfilled with the updated user data.
verifyIdToken
verifyIdToken(idToken) returns Promise containing non-null Object
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 ObjectA promise fulfilled with the token's decoded claims if the ID token is valid; otherwise, a rejected promise.

