Partilhar via


ConfidentialClientApplicationBuilder.WithClientAssertion Method

Definition

Overloads

WithClientAssertion(String)
Obsolete.

Sets the application client assertion. See https://aka.ms/msal-net-client-assertion. This will create an assertion that will be held within the client application's memory for the duration of the client. You can use WithClientAssertion(Func<String>) to set a delegate that will be executed for each authentication request. This will allow you to update the client assertion used by the client application once the assertion expires.

WithClientAssertion(Func<CancellationToken,Task<String>>)

Configures an async delegate that creates a client assertion. See https://aka.ms/msal-net-client-assertion

WithClientAssertion(Func<String>)

Configures a delegate that creates a client assertion. See https://aka.ms/msal-net-client-assertion

WithClientAssertion(Func<AssertionRequestOptions,Task<String>>)

Configures an async delegate that creates a client assertion. The delegate is invoked only when a token cannot be retrieved from the cache. See https://aka.ms/msal-net-client-assertion

WithClientAssertion(String)

Caution

This method is not recommended. Use overload with Func<AssertionRequestOptions, Task<string>> instead, and return a non-expired assertion, which can be a Federated Credential. See https://aka.ms/msal-net-client-assertion

Sets the application client assertion. See https://aka.ms/msal-net-client-assertion. This will create an assertion that will be held within the client application's memory for the duration of the client. You can use WithClientAssertion(Func<String>) to set a delegate that will be executed for each authentication request. This will allow you to update the client assertion used by the client application once the assertion expires.

[System.Obsolete("This method is not recommended. Use overload with Func<AssertionRequestOptions, Task<string>> instead, and return a non-expired assertion, which can be a Federated Credential. See https://aka.ms/msal-net-client-assertion", false)]
public Microsoft.Identity.Client.ConfidentialClientApplicationBuilder WithClientAssertion (string signedClientAssertion);
[<System.Obsolete("This method is not recommended. Use overload with Func<AssertionRequestOptions, Task<string>> instead, and return a non-expired assertion, which can be a Federated Credential. See https://aka.ms/msal-net-client-assertion", false)>]
member this.WithClientAssertion : string -> Microsoft.Identity.Client.ConfidentialClientApplicationBuilder
Public Function WithClientAssertion (signedClientAssertion As String) As ConfidentialClientApplicationBuilder

Parameters

signedClientAssertion
String

The client assertion used to prove the identity of the application to Azure AD. This is a Base-64 encoded JWT.

Returns

Attributes

Applies to

WithClientAssertion(Func<CancellationToken,Task<String>>)

Configures an async delegate that creates a client assertion. See https://aka.ms/msal-net-client-assertion

public Microsoft.Identity.Client.ConfidentialClientApplicationBuilder WithClientAssertion (Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<string>> clientAssertionAsyncDelegate);
member this.WithClientAssertion : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<string>> -> Microsoft.Identity.Client.ConfidentialClientApplicationBuilder
Public Function WithClientAssertion (clientAssertionAsyncDelegate As Func(Of CancellationToken, Task(Of String))) As ConfidentialClientApplicationBuilder

Parameters

clientAssertionAsyncDelegate
Func<CancellationToken,Task<String>>

An async delegate computing the client assertion used to prove the identity of the application to Azure AD. This is a delegate that computes a Base-64 encoded JWT for each authentication call.

Returns

The ConfidentialClientApplicationBuilder to chain more .With methods

Remarks

Callers can use this mechanism to cache their assertions

Applies to

WithClientAssertion(Func<String>)

Configures a delegate that creates a client assertion. See https://aka.ms/msal-net-client-assertion

public Microsoft.Identity.Client.ConfidentialClientApplicationBuilder WithClientAssertion (Func<string> clientAssertionDelegate);
member this.WithClientAssertion : Func<string> -> Microsoft.Identity.Client.ConfidentialClientApplicationBuilder
Public Function WithClientAssertion (clientAssertionDelegate As Func(Of String)) As ConfidentialClientApplicationBuilder

Parameters

clientAssertionDelegate
Func<String>

delegate computing the client assertion used to prove the identity of the application to Azure AD. This is a delegate that computes a Base-64 encoded JWT for each authentication call.

Returns

The ConfidentialClientApplicationBuilder to chain more .With methods

Remarks

Callers can use this mechanism to cache their assertions

Applies to

WithClientAssertion(Func<AssertionRequestOptions,Task<String>>)

Configures an async delegate that creates a client assertion. The delegate is invoked only when a token cannot be retrieved from the cache. See https://aka.ms/msal-net-client-assertion

public Microsoft.Identity.Client.ConfidentialClientApplicationBuilder WithClientAssertion (Func<Microsoft.Identity.Client.AssertionRequestOptions,System.Threading.Tasks.Task<string>> clientAssertionAsyncDelegate);
member this.WithClientAssertion : Func<Microsoft.Identity.Client.AssertionRequestOptions, System.Threading.Tasks.Task<string>> -> Microsoft.Identity.Client.ConfidentialClientApplicationBuilder
Public Function WithClientAssertion (clientAssertionAsyncDelegate As Func(Of AssertionRequestOptions, Task(Of String))) As ConfidentialClientApplicationBuilder

Parameters

clientAssertionAsyncDelegate
Func<AssertionRequestOptions,Task<String>>

An async delegate that returns the client assertion. Assertion lifetime is the responsibility of the caller.

Returns

The ConfidentialClientApplicationBuilder to chain more .With methods

Remarks

Callers can use this mechanism to cache their assertions

Applies to