Member Junction
    Preparing search index...

    Configuration options for OAuth2Manager

    interface OAuth2Config {
        accessToken?: string;
        additionalHeaders?: Record<string, string>;
        authorizationEndpoint?: string;
        clientId: string;
        clientSecret: string;
        onTokenUpdate?: (tokens: OAuth2TokenData) => void | Promise<void>;
        redirectUri?: string;
        refreshBufferMs?: number;
        refreshToken?: string;
        scopes?: string[];
        tokenEndpoint: string;
        tokenExpiresAt?: number;
        tokenRequestTransform?: (
            params: Record<string, string>,
        ) => Record<string, string>;
        tokenResponseTransform?: (response: any) => OAuth2TokenResponse;
    }
    Index

    Properties

    accessToken?: string

    Initial access token (if already obtained)

    additionalHeaders?: Record<string, string>

    Additional headers to include in token requests

    authorizationEndpoint?: string

    Authorization endpoint URL (e.g., 'https://api.example.com/oauth/authorize') Only needed for authorization_code flow

    clientId: string

    OAuth2 client ID

    clientSecret: string

    OAuth2 client secret

    onTokenUpdate?: (tokens: OAuth2TokenData) => void | Promise<void>

    Callback invoked when tokens are updated (for persistence)

    redirectUri?: string

    Redirect URI for authorization_code flow

    refreshBufferMs?: number

    Buffer time in milliseconds before token expiration to trigger refresh (default: 60000 = 1 minute)

    refreshToken?: string

    Initial refresh token (if available)

    scopes?: string[]

    OAuth2 scopes to request

    tokenEndpoint: string

    Token endpoint URL (e.g., 'https://api.example.com/oauth/token')

    tokenExpiresAt?: number

    Initial token expiration timestamp (milliseconds since epoch)

    tokenRequestTransform?: (
        params: Record<string, string>,
    ) => Record<string, string>

    Custom transformation for token request body (for provider-specific requirements)

    tokenResponseTransform?: (response: any) => OAuth2TokenResponse

    Custom transformation for token response (for non-standard OAuth2 implementations)