Language

ManagedIdentityApplication.GetManagedIdentityCapabilitiesAsync Method

Definition

Overloads

Name Description
GetManagedIdentityCapabilitiesAsync(CancellationToken)

Detects the managed identity source available on the host and the strongest mTLS binding the host can produce. Useful for credential chains (such as DefaultAzureCredential) to decide whether managed identity is available and what binding strength to expect.

GetManagedIdentityCapabilitiesAsync(ManagedIdentityCapabilitiesOptions, CancellationToken)

Detects the managed identity source available on the host and the strongest mTLS binding the host can produce, using the supplied discovery options.

GetManagedIdentityCapabilitiesAsync(CancellationToken)

Detects the managed identity source available on the host and the strongest mTLS binding the host can produce. Useful for credential chains (such as DefaultAzureCredential) to decide whether managed identity is available and what binding strength to expect.

public System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentityCapabilities> GetManagedIdentityCapabilitiesAsync(System.Threading.CancellationToken cancellationToken);
member this.GetManagedIdentityCapabilitiesAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentityCapabilities>
Public Function GetManagedIdentityCapabilitiesAsync (cancellationToken As CancellationToken) As Task(Of ManagedIdentityCapabilities)

Parameters

cancellationToken
CancellationToken

A cancellation token to observe while waiting for the detection to complete.

Returns

A ManagedIdentityCapabilities describing the detected source and host capabilities.

Remarks

On hosts capable of key binding, detecting the strongest available strength may provision (and persist) a binding key as a side effect, pre-warming the cache reused by a subsequent token request. The key provider is created once per process and its key is cached.

Applies to

GetManagedIdentityCapabilitiesAsync(ManagedIdentityCapabilitiesOptions, CancellationToken)

Detects the managed identity source available on the host and the strongest mTLS binding the host can produce, using the supplied discovery options.

public System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentityCapabilities> GetManagedIdentityCapabilitiesAsync(Microsoft.Identity.Client.ManagedIdentity.ManagedIdentityCapabilitiesOptions options, System.Threading.CancellationToken cancellationToken);
member this.GetManagedIdentityCapabilitiesAsync : Microsoft.Identity.Client.ManagedIdentity.ManagedIdentityCapabilitiesOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentityCapabilities>
Public Function GetManagedIdentityCapabilitiesAsync (options As ManagedIdentityCapabilitiesOptions, cancellationToken As CancellationToken) As Task(Of ManagedIdentityCapabilities)

Parameters

options
ManagedIdentityCapabilitiesOptions

Options that control managed identity capability discovery.

cancellationToken
CancellationToken

A cancellation token to observe while waiting for the detection to complete.

Returns

A ManagedIdentityCapabilities describing the detected source and host capabilities.

Exceptions

Thrown when options is null.

Thrown when CapabilityDiscoveryTimeout is not positive or exceeds the maximum timeout supported across MSAL target frameworks.

Thrown when cancellationToken is canceled before or during uncached discovery.

Thrown with error code RequestTimeout when capability discovery exceeds CapabilityDiscoveryTimeout.

Applies to