Sprog

MsalAuth.GetAgenticUserTokenAsync Method

Definition

Acquires an agentic user token that represents the agent acting on behalf of a specific agentic user for the requested scopes.

public System.Threading.Tasks.Task<string> GetAgenticUserTokenAsync(string tenantId, string agentAppInstanceId, string agenticUserId, System.Collections.Generic.IList<string> scopes, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAgenticUserTokenAsync : string * string * string * System.Collections.Generic.IList<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
override this.GetAgenticUserTokenAsync : string * string * string * System.Collections.Generic.IList<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function GetAgenticUserTokenAsync (tenantId As String, agentAppInstanceId As String, agenticUserId As String, scopes As IList(Of String), Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

Parameters

tenantId
String

The Entra tenant id the agent identity and user belong to.

agentAppInstanceId
String

The agent application instance id (the client id of the agent identity).

agenticUserId
String
scopes
IList<String>

The scopes to request for the resource the user token targets. When null or empty, the provider falls back to its configured default scope.

cancellationToken
CancellationToken

A token to cancel the asynchronous operation.

Returns

A task that resolves to the access token for the agentic user.

Implements

Applies to