Share via


AcquireTokenForClientParameterBuilderForResourceProviders.WithAccessTokenSha256ToRefresh Method

Definition

Configures the SDK to not retrieve a token from the cache if it matches the SHA256 hash of the token configured. Similar to WithForceRefresh(bool) API, but instead of bypassing the cache for all tokens, the cache bypass only occurs for 1 token

public static Microsoft.Identity.Client.AcquireTokenForClientParameterBuilder WithAccessTokenSha256ToRefresh(this Microsoft.Identity.Client.AcquireTokenForClientParameterBuilder builder, string hash);
static member WithAccessTokenSha256ToRefresh : Microsoft.Identity.Client.AcquireTokenForClientParameterBuilder * string -> Microsoft.Identity.Client.AcquireTokenForClientParameterBuilder
<Extension()>
Public Function WithAccessTokenSha256ToRefresh (builder As AcquireTokenForClientParameterBuilder, hash As String) As AcquireTokenForClientParameterBuilder

Parameters

builder
AcquireTokenForClientParameterBuilder

The existing AcquireTokenForClientParameterBuilder instance.

hash
String

A Base64-encoded SHA-256 hash of the token (UTF-8). For example: Convert.ToBase64String(SHA256(Encoding.UTF8.GetBytes(accessToken))).

Returns

The builder to chain the .With methods.

Applies to