ART Framework API Docs
    Preparing search index...

    Interface IAuthStrategy

    Interface for an authentication strategy that can provide authorization headers. This enables pluggable security for remote service connections (MCP servers, A2A agents, etc.)

    interface IAuthStrategy {
        getAuthHeaders(): Promise<Record<string, string>>;
        handleRedirect(): Promise<void>;
        isAuthenticated(): Promise<boolean>;
        login(): Promise<void>;
        logout(): void;
    }

    Implemented by

    Index

    Methods

    • Asynchronously retrieves the authentication headers. This might involve checking a cached token, refreshing it if expired, and then returning it.

      Returns Promise<Record<string, string>>

      A promise that resolves to a record of header keys and values.

      If authentication fails or cannot be obtained.

    • Optional: Handles the redirect from the authentication server.

      Returns Promise<void>

    • Optional: Checks if the user is authenticated.

      Returns Promise<boolean>

    • Optional: Initiates the login flow for the strategy.

      Returns Promise<void>