ADK for TypeScript: API Reference
    Preparing search index...

    Class AuthHandler

    A handler that handles the auth flow in Agent Development Kit to help orchestrates the credential request and response flow (e.g. OAuth flow) This class should only be used by Agent Development Kit.

    Constructors

    Methods

    • Generates an response containing the auth uri for user to sign in.

      When the credential requests PKCE, the URI also carries the S256 code challenge derived from the credential's code verifier, and the returned credential carries the verifier the later token exchange must send.

      Returns AuthCredential | undefined

      An AuthCredential object containing the auth URI and state.

      Error: If the authorization endpoint is not configured in the auth scheme, or the credential requests a code challenge method other than 'S256'.

    • Stores the exchanged credential in the session state.

      Parameters

      • state: State

        The session state to store the credential in.

      Returns Promise<void>

      Error: If the auth config has no credentialKey.