UserRecord class Stay organized with collections Save and categorize content based on your preferences.
Represents a user.
Signature:
exportdeclareclassUserRecordProperties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| customClaims | { [key: string]: any; } | The user's custom claims object if available, typically used to define user roles and propagated to an authenticated user's ID token. This is set viaBaseAuth.setCustomUserClaims() | |
| disabled | boolean | Whether or not the user is disabled:true for disabled;false for enabled. | |
| displayName | string | The user's display name. | |
| string | The user's primary email, if set. | ||
| emailVerified | boolean | Whether or not the user's primary email is verified. | |
| metadata | UserMetadata | Additional metadata about the user. | |
| multiFactor | MultiFactorSettings | The multi-factor related properties for the current user, if available. | |
| passwordHash | string | The user's hashed password (base64-encoded), only if Firebase Auth hashing algorithm (SCRYPT) is used. If a different hashing algorithm had been used when uploading this user, as is typical when migrating from another Auth system, this will be an empty string. If no password is set, this is null. This is only available when the user is obtained fromBaseAuth.listUsers(). | |
| passwordSalt | string | The user's password salt (base64-encoded), only if Firebase Auth hashing algorithm (SCRYPT) is used. If a different hashing algorithm had been used to upload this user, typical when migrating from another Auth system, this will be an empty string. If no password is set, this is null. This is only available when the user is obtained fromBaseAuth.listUsers(). | |
| phoneNumber | string | The user's primary phone number, if set. | |
| photoURL | string | The user's photo URL. | |
| providerData | UserInfo[] | An array of providers (for example, Google, Facebook) linked to the user. | |
| tenantId | string | null | The ID of the tenant the user belongs to, if available. | |
| tokensValidAfterTime | string | The date the user's tokens are valid after, formatted as a UTC string. This is updated every time the user's refresh token are revoked either from theBaseAuth.revokeRefreshTokens() API or from the Firebase Auth backend on big account changes (password resets, password or email updates, etc). | |
| uid | string | The user'suid. |
Methods
| Method | Modifiers | Description |
|---|---|---|
| toJSON() | Returns a JSON-serializable representation of this object. |
UserRecord.customClaims
The user's custom claims object if available, typically used to define user roles and propagated to an authenticated user's ID token. This is set viaBaseAuth.setCustomUserClaims()
Signature:
readonlycustomClaims?:{[key:string]:any;};UserRecord.disabled
Whether or not the user is disabled:true for disabled;false for enabled.
Signature:
readonlydisabled:boolean;UserRecord.displayName
The user's display name.
Signature:
readonlydisplayName?:string;UserRecord.email
The user's primary email, if set.
Signature:
readonlyemail?:string;UserRecord.emailVerified
Whether or not the user's primary email is verified.
Signature:
readonlyemailVerified:boolean;UserRecord.metadata
Additional metadata about the user.
Signature:
readonlymetadata:UserMetadata;UserRecord.multiFactor
The multi-factor related properties for the current user, if available.
Signature:
readonlymultiFactor?:MultiFactorSettings;UserRecord.passwordHash
The user's hashed password (base64-encoded), only if Firebase Auth hashing algorithm (SCRYPT) is used. If a different hashing algorithm had been used when uploading this user, as is typical when migrating from another Auth system, this will be an empty string. If no password is set, this is null. This is only available when the user is obtained fromBaseAuth.listUsers().
Signature:
readonlypasswordHash?:string;UserRecord.passwordSalt
The user's password salt (base64-encoded), only if Firebase Auth hashing algorithm (SCRYPT) is used. If a different hashing algorithm had been used to upload this user, typical when migrating from another Auth system, this will be an empty string. If no password is set, this is null. This is only available when the user is obtained fromBaseAuth.listUsers().
Signature:
readonlypasswordSalt?:string;UserRecord.phoneNumber
The user's primary phone number, if set.
Signature:
readonlyphoneNumber?:string;UserRecord.photoURL
The user's photo URL.
Signature:
readonlyphotoURL?:string;UserRecord.providerData
An array of providers (for example, Google, Facebook) linked to the user.
Signature:
readonlyproviderData:UserInfo[];UserRecord.tenantId
The ID of the tenant the user belongs to, if available.
Signature:
readonlytenantId?:string|null;UserRecord.tokensValidAfterTime
The date the user's tokens are valid after, formatted as a UTC string. This is updated every time the user's refresh token are revoked either from theBaseAuth.revokeRefreshTokens() API or from the Firebase Auth backend on big account changes (password resets, password or email updates, etc).
Signature:
readonlytokensValidAfterTime?:string;UserRecord.uid
The user'suid.
Signature:
readonlyuid:string;UserRecord.toJSON()
Returns a JSON-serializable representation of this object.
Signature:
toJSON():object;Returns:
object
A JSON-serializable representation of this object.
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-29 UTC.