AuthorizationLike interface

Minimal authorization shape required by AgenticTokenCache.

Mirrors the Authorization interface from @microsoft/agents-hosting so the cache can be used without a direct dependency on that package.

Methods

exchangeToken(TurnContextLike, string, { scopes: string[] })

Exchanges the current turn's credentials for an access token.

Method Details

exchangeToken(TurnContextLike, string, { scopes: string[] })

Exchanges the current turn's credentials for an access token.

function exchangeToken(turnContext: TurnContextLike, authHandlerName: string, options: { scopes: string[] }): Promise<{ token?: string } | undefined>

Parameters

turnContext
TurnContextLike

The current turn context.

authHandlerName

string

Name of the configured auth handler to use.

options

{ scopes: string[] }

Token-exchange options, including the requested scopes.

Returns

Promise<{ token?: string } | undefined>

The exchanged token, or undefined when no token is available.