GetTokenResult

public class GetTokenResult


Result object that contains a Firebase Auth ID Token.

Summary

Public methods

long

Returns the authentication timestamp in seconds since epoch.

@NonNull Map<StringObject>

Returns the entire payload claims of the ID token including the standard reserved claims as well as the custom claims (set by developer via Admin SDK).

long

Returns the time in seconds since epoch at which this ID token will expire

long

Returns the issued at timestamp in seconds since epoch.

@Nullable String

Returns the sign-in provider through which the ID token was obtained (anonymous, custom, phone, password, etc).

@Nullable String

Firebase Auth ID Token.

Public fields

claims

public Map<StringObjectclaims

token

public @Nullable String token

Public methods

getAuthTimestamp

public long getAuthTimestamp()

Returns the authentication timestamp in seconds since epoch. This is the time the user authenticated (signed in) and not the time the token was refreshed.

getClaims

public @NonNull Map<StringObjectgetClaims()

Returns the entire payload claims of the ID token including the standard reserved claims as well as the custom claims (set by developer via Admin SDK). Developers should verify the ID token and parse claims from its payload on the backend and never trust this value on the client. Returns an empty map if no claims are present.

getExpirationTimestamp

public long getExpirationTimestamp()

Returns the time in seconds since epoch at which this ID token will expire

getIssuedAtTimestamp

public long getIssuedAtTimestamp()

Returns the issued at timestamp in seconds since epoch. This is the time the ID token was last refreshed and not the authentication timestamp.

getSignInProvider

public @Nullable String getSignInProvider()

Returns the sign-in provider through which the ID token was obtained (anonymous, custom, phone, password, etc). Note, this does not map to provider IDs. For example, anonymous and custom authentications are not considered providers. We chose the name here to map the name used in the ID token.

getToken

public @Nullable String getToken()

Firebase Auth ID Token. Useful for authenticating calls against your own backend. Verify the integrity and validity of the token in your server either by using our server SDKs or following the documentation.