Share via


AgenticAuthenticationService class

Service for handling agentic user authentication.

Methods

GetAgenticUserToken(Authorization, string, TurnContext)

Gets an agentic user token for platform authentication. Uses the default MCP platform authentication scope.

GetAgenticUserToken(Authorization, string, TurnContext, string[])

Gets an agentic user token for platform authentication.

Method Details

GetAgenticUserToken(Authorization, string, TurnContext)

Warning

This API is now deprecated.

Use the overload with explicit scopes parameter for better control over requested permissions.

Gets an agentic user token for platform authentication. Uses the default MCP platform authentication scope.

static function GetAgenticUserToken(authorization: Authorization, authHandlerName: string, turnContext: TurnContext): Promise<string>

Parameters

authorization
Authorization

The authorization handler.

authHandlerName

string

The name of the auth handler to use.

turnContext
TurnContext

The turn context for the current request.

Returns

Promise<string>

The token string, or empty string if no token was returned.

GetAgenticUserToken(Authorization, string, TurnContext, string[])

Gets an agentic user token for platform authentication.

static function GetAgenticUserToken(authorization: Authorization, authHandlerName: string, turnContext: TurnContext, scopes: string[]): Promise<string>

Parameters

authorization
Authorization

The authorization handler.

authHandlerName

string

The name of the auth handler to use.

turnContext
TurnContext

The turn context for the current request.

scopes

string[]

The OAuth scopes to request. Should be obtained from the appropriate configuration (e.g., ToolingConfiguration.mcpPlatformAuthenticationScope).

Returns

Promise<string>

The token string, or empty string if no token was returned.