Standardized token information returned by all auth providers

Provides access to tokens without exposing provider-specific claim structures. Each provider implements extractTokenInfoInternal() to extract tokens from their specific storage format.

Example

const tokenInfo = await this.authBase.getTokenInfo();
console.log(`Token expires at: ${new Date(tokenInfo.expiresAt)}`);
interface StandardAuthToken {
    accessToken?: string;
    expiresAt: number;
    idToken: string;
    scopes?: string[];
}

Properties

accessToken?: string

Access token for calling APIs (if different from ID token)

Some providers (like Auth0) use the same token for both authentication and API access. Others (like MSAL) provide separate tokens.

expiresAt: number

Token expiration timestamp (milliseconds since epoch)

Use this to determine if the token needs to be refreshed.

Example

const isExpired = Date.now() >= tokenInfo.expiresAt;
if (isExpired) {
await this.authBase.refreshToken();
}
idToken: string

The ID token as a JWT string

This is what should be sent to the backend GraphQL API in the Authorization header as "Bearer {idToken}"

scopes?: string[]

OAuth scopes granted with this token

Example

["openid", "profile", "email", "User.Read"]