Jump to top

IdTokenResult

interface

Interface representing ID token result obtained from User#getIdTokenResult. It contains the ID token JWT string and other helper properties for getting different data associated with the token as well as all the decoded payload claims.

TODO @salakar validate timestamp types

Example
const idTokenResult = await firebase.auth().currentUser.getIdTokenResult();
console.log('User JWT: ', idTokenResult.token);

Properties

authTime

</>

The authentication time formatted as a UTC string. This is the time the user authenticated (signed in) and not the time the token was refreshed.

authTime: string;

claims

</>

The entire payload claims of the ID token including the standard reserved claims as well as the custom claims.

claims: { [key: string]: any };

expirationTime

</>

The ID token expiration time formatted as a UTC string.

expirationTime: string;

issuedAtTime

</>

The ID token issued at time formatted as a UTC string.

issuedAtTime: string;

signInProvider

</>

The sign-in provider through which the ID token was obtained (anonymous, custom, phone, password, etc). Note, this does not map to provider IDs.

signInProvider: null | string;

token

</>

The Firebase Auth ID token JWT string.

token: string;