UserRecord

public class UserRecord extends Object
implements UserInfo
Known Direct Subclasses

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

Nested Class Summary

class UserRecord.CreateRequest A specification class for creating new user accounts. 
class UserRecord.UpdateRequest A 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 of UserInfo objects that represents the identities from different identity providers that are linked to this user.
String
getProviderId()
Returns the provider ID of this user.
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 new UserRecord.UpdateRequest, which can be used to update the attributes of this user.

Inherited Method Summary

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 String getDisplayName ()

Returns the display name of this user.

Returns
  • a display name string or null.

public String getEmail ()

Returns the email address associated with this user.

Returns
  • an email address string or null.

public String getPhoneNumber ()

Returns the phone number associated with this user.

Returns
  • a phone number string or null.

public String getPhotoUrl ()

Returns the photo URL of this user.

Returns
  • a URL string or null.

public UserInfo[] getProviderData ()

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

Returns
  • an array of UserInfo instances, which may be empty.

public String getProviderId ()

Returns the provider ID of this user.

Returns
  • a constant provider ID value.

public long getTokensValidAfterTimestamp ()

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 String getUid ()

Returns the user ID of this user.

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

public UserMetadata getUserMetadata ()

Returns additional metadata associated with this user.

Returns
  • a non-null UserMetadata instance.

public boolean isDisabled ()

Returns whether this user account is disabled.

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

public boolean isEmailVerified ()

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

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

public UserRecord.UpdateRequest updateRequest ()

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

Returns
  • a non-null UserRecord.UpdateRequest instance.

Send feedback about...

Need help? Visit our support page.