@mcp-z/client
    Preparing search index...

    Class InteractiveOAuthFlow

    InteractiveOAuthFlow manages the complete OAuth authorization code flow

    Index
    • Perform OAuth authorization code flow

      Parameters

      • authorizationEndpoint: string

        OAuth authorization endpoint URL

      • tokenEndpoint: string

        OAuth token endpoint URL

      • clientId: string

        OAuth client ID

      • clientSecret: string

        OAuth client secret

      • options: OAuthFlowOptions

        Flow options (port is required - use get-port to find available port)

      Returns Promise<TokenSet>

      Token set with access and refresh tokens

      Error if flow fails or times out

      import getPort from 'get-port';

      const flow = new InteractiveOAuthFlow();
      const port = await getPort();
      const tokens = await flow.performAuthFlow(
      'https://example.com/oauth/authorize',
      'https://example.com/oauth/token',
      'client-id',
      'client-secret',
      { port, scopes: ['read', 'write'] }
      );
    • Refresh access token using refresh token

      Parameters

      • tokenEndpoint: string

        OAuth token endpoint URL

      • refreshToken: string

        Refresh token from previous token set

      • clientId: string

        OAuth client ID

      • clientSecret: string

        OAuth client secret

      Returns Promise<TokenSet>

      New token set with refreshed access token

      Error if refresh fails