UserRecord

public classUserRecord extends Object
implementsUserInfo
Known Direct Subclasses
ExportedUserRecordContains metadata associated with a Firebase user account, along with password hash and salt. 

Contains metadata associated with a Firebase user account. Instances of this class are immutable and thread safe.

Nested Class Summary

classUserRecord.CreateRequestA specification class for creating new user accounts. 
classUserRecord.UpdateRequestA class for updating the attributes of an existing user. 

Public Method Summary

Map<String, Object>
getCustomClaims()
Returns custom claims set on this user.
String
getDisplayName()
Returns the display name of this user.
String
getEmail()
Returns the email address associated with this user.
String
getPhoneNumber()
Returns the phone number associated with this user.
String
getPhotoUrl()
Returns the photo URL of this user.
UserInfo[]
getProviderData()
Returns an array ofUserInfo objects that represents the identities from different identity providers that are linked to this user.
String
getProviderId()
Returns the provider ID of this user.
String
getTenantId()
Returns the tenant ID associated with this user, if one exists.
long
getTokensValidAfterTimestamp()
Returns a timestamp in milliseconds since epoch, truncated down to the closest second.
String
getUid()
Returns the user ID of this user.
UserMetadata
getUserMetadata()
Returns additional metadata associated with this user.
boolean
isDisabled()
Returns whether this user account is disabled.
boolean
isEmailVerified()
Returns whether the email address of this user has been verified.
UserRecord.UpdateRequest
updateRequest()
Returns a newUserRecord.UpdateRequest, which can be used to update the attributes of this user.

Inherited Method Summary

From class java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
From interfacecom.google.firebase.auth.UserInfo
abstract String
getDisplayName()
Returns the user's display name, if available.
abstract String
getEmail()
Returns the user's email address, if available.
abstract String
getPhoneNumber()
Returns the user's phone number, if available.
abstract String
getPhotoUrl()
Returns the user's photo URL, if available.
abstract String
getProviderId()
Returns the ID of the identity provider.
abstract String
getUid()
Returns the user's unique ID assigned by the identity provider.

Public Methods

public Map<String, Object>getCustomClaims()

Returns custom claims set on this user.

Returns
  • a non-null, immutable Map of custom claims, possibly empty.

public StringgetDisplayName()

Returns the display name of this user.

Returns
  • a display name string or null.

public StringgetEmail()

Returns the email address associated with this user.

Returns
  • an email address string or null.

public StringgetPhoneNumber()

Returns the phone number associated with this user.

Returns
  • a phone number string or null.

public StringgetPhotoUrl()

Returns the photo URL of this user.

Returns
  • a URL string or null.

publicUserInfo[]getProviderData()

Returns an array ofUserInfo objects that represents the identities from different identity providers that are linked to this user.

Returns
  • an array ofUserInfo instances, which may be empty.

public StringgetProviderId()

Returns the provider ID of this user.

Returns
  • a constant provider ID value.

public StringgetTenantId()

Returns the tenant ID associated with this user, if one exists.

Returns
  • a tenant ID string or null.

public longgetTokensValidAfterTimestamp()

Returns a timestamp in milliseconds since epoch, truncated down to the closest second. Tokens minted before this timestamp are considered invalid.

Returns
  • Timestamp in milliseconds since the epoch. Tokens minted before this timestamp are considered invalid.

public StringgetUid()

Returns the user ID of this user.

Returns
  • a non-null, non-empty user ID string.

publicUserMetadatagetUserMetadata()

Returns additional metadata associated with this user.

Returns
  • a non-null UserMetadata instance.

public booleanisDisabled()

Returns whether this user account is disabled.

Returns
  • true if the user account is disabled, and false otherwise.

public booleanisEmailVerified()

Returns whether the email address of this user has been verified.

Returns
  • true if the email has been verified, and false otherwise.

publicUserRecord.UpdateRequestupdateRequest()

Returns a newUserRecord.UpdateRequest, which can be used to update the attributes of this user.

Returns
  • a non-null UserRecord.UpdateRequest instance.

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 2021-04-28 UTC.