@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Function getAuthToken

    • Get authentication token for an agent.

      Returns, in order:

      1. The cached client-credentials access token (when the agent declares oauth_client_credentials). These tokens are refreshed via secret re-exchange, not the MCP SDK's refresh_token grant, so the bearer path is the correct transport — there is no "refresh on 401" hook the SDK can use, and the call path pre-refreshes them anyway.
      2. The static auth_token.

      Tokens from the authorization-code flow (oauth_tokens without oauth_client_credentials) are handled separately by the OAuth provider path in ProtocolClient.callTool and intentionally do NOT surface here.

      Parameters

      Returns string | undefined