OAuthSession

tcmts.atproto.OAuthSession · #mkhka36y · type

A signed-in account, as kept: who, and the tokens to call its PDS as them, bound to a DPoP key.

import type crypto from "node:crypto";

export interface OAuthSession {
  did: string;
  handle?: string;
  pds: string;
  /** the authorization server that issued the tokens */
  issuer: string;
  tokenEndpoint: string;
  /** the loopback client id signed in as (refreshing uses it again) */
  clientId: string;
  /** the P-256 private key the tokens are bound to, as a JWK */
  dpopKey: crypto.JsonWebKey;
  accessToken: string;
  refreshToken?: string;
  /** when the access token expires (ms since the epoch) */
  expiresAt: number;
  scope: string;
}

used by