Interface Account

Usually contains information about the provider being used and also extends TokenSet, which is different tokens returned by OAuth Providers.

interface Account {
    access_token?: string;
    authorization_details?: AuthorizationDetails[];
    expires_at?: number;
    expires_in?: number;
    id_token?: string;
    provider: string;
    providerAccountId: string;
    refresh_token?: string;
    scope?: string;
    token_type?: Lowercase<string>;
    type: ProviderType;
    userId?: string;
}

Hierarchy

  • Partial<TokenEndpointResponse>
    • Account

Properties

access_token?: string
authorization_details?: AuthorizationDetails[]
expires_at?: number

Calculated value based on TokenEndpointResponse.expires_in.

It is the absolute timestamp (in seconds) when the TokenEndpointResponse.access_token expires.

This value can be used for implementing token rotation together with TokenEndpointResponse.refresh_token.

expires_in?: number
id_token?: string
provider: string

Provider's id for this account. E.g. "google". See the full list at https://authjs.dev/reference/core/providers

providerAccountId: string

This value depends on the type of the provider being used to create the account.

  • oauth/oidc: The OAuth account's id, returned from the profile() callback.
  • email: The user's email address.
  • credentials: id returned from the authorize() callback
refresh_token?: string
scope?: string
token_type?: Lowercase<string>

NOTE: because the value is case insensitive it is always returned lowercased

type: ProviderType

Provider's type for this account

userId?: string

id of the user this account belongs to