MsalAuth.GetAgenticUserTokenAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.