Language

AbstractManagedIdentityAcquireTokenParameterBuilder<T> Class

Definition

Abstract base class for managed identity application token request builders.

public abstract class AbstractManagedIdentityAcquireTokenParameterBuilder<T> : Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<T> where T : BaseAbstractAcquireTokenParameterBuilder<T>
type AbstractManagedIdentityAcquireTokenParameterBuilder<'T (requires 'T :> BaseAbstractAcquireTokenParameterBuilder<'T>)> = class
    inherit BaseAbstractAcquireTokenParameterBuilder<'T (requires 'T :> BaseAbstractAcquireTokenParameterBuilder<'T>)>
Public MustInherit Class AbstractManagedIdentityAcquireTokenParameterBuilder(Of T)
Inherits BaseAbstractAcquireTokenParameterBuilder(Of T)

Type Parameters

T
Inheritance
AbstractManagedIdentityAcquireTokenParameterBuilder<T>
Derived

Constructors

Name Description
AbstractManagedIdentityAcquireTokenParameterBuilder<T>()

Default constructor for AbstractManagedIdentityParameterBuilder.

Methods

Name Description
ExecuteAsync()

Executes the Token request asynchronously.

(Inherited from BaseAbstractAcquireTokenParameterBuilder<T>)
ExecuteAsync(CancellationToken)

Executes the Token request asynchronously, with a possibility of cancelling the asynchronous method.

Validate()

Validates the parameters of the AcquireToken operation.

(Inherited from BaseAbstractAcquireTokenParameterBuilder<T>)
WithCorrelationId(Guid)

Sets the correlation id to be used in the authentication request. Used to track a request in the logs of both the SDK and the Identity Provider service. If not set, a random one will be generated.

(Inherited from BaseAbstractAcquireTokenParameterBuilder<T>)
WithExtraQueryParameters(Dictionary<String,String>)
Obsolete.

Sets Extra Query Parameters for the query string in the HTTP authentication request.

(Inherited from BaseAbstractAcquireTokenParameterBuilder<T>)
WithExtraQueryParameters(IDictionary<String,ValueTuple<String,Boolean>>)

Sets Extra Query Parameters for the query string in the HTTP authentication request with control over which parameters are included in the cache key

(Inherited from BaseAbstractAcquireTokenParameterBuilder<T>)

Extension Methods

Name Description
WithCachePartitionKey<T>(BaseAbstractAcquireTokenParameterBuilder<T>, String, String, Boolean)

Adds a key-value pair to the token cache key without sending it as a query parameter. Use this to partition cached tokens (e.g., isolating short-lived sessions from regular sessions for the same user). Both AcquireTokenByAuthorizationCode and AcquireTokenSilent must use the same partition key to match cached entries.

WithCachePartitionKey<T>(BaseAbstractAcquireTokenParameterBuilder<T>, String, String)

Adds a key-value pair to the token cache key without sending it as a query parameter. Use this to partition cached access tokens (e.g., isolating short-lived sessions from regular sessions for the same user). Both AcquireTokenByAuthorizationCode and AcquireTokenSilent must use the same partition key to match cached entries.

WithOtelTagsEnricher<T>(AbstractManagedIdentityAcquireTokenParameterBuilder<T>, Action<ExecutionResult,IList<KeyValuePair<String,Object>>>)

Registers a delegate that adds additional tags (dimensions) to the OpenTelemetry metrics MSAL emits for this managed identity token acquisition. The delegate is invoked while MSAL records its metrics and receives the ExecutionResult of the acquisition (indicating success or failure, with the result or exception) together with a mutable list of tags. Tags appended to that list are attached to every metric recorded for the request, including metrics emitted during proactive background refresh.

Applies to