Language

AcquireTokenParameterBuilderExtensions.WithCachePartitionKey Method

Definition

Overloads

Name Description
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.

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.

public static T WithCachePartitionKey<T>(this Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<T> builder, string key, string value) where T : Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<T>;
static member WithCachePartitionKey : Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<'T (requires 'T :> Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<'T>)> * string * string -> 'T (requires 'T :> Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<'T>)
<Extension()>
Public Function WithCachePartitionKey(Of T As BaseAbstractAcquireTokenParameterBuilder(Of T)) (builder As BaseAbstractAcquireTokenParameterBuilder(Of T), key As String, value As String) As T

Type Parameters

T

Parameters

builder
BaseAbstractAcquireTokenParameterBuilder<T>

The builder to chain .With methods.

key
String

The partition key name.

value
String

The partition key value.

Returns

T

The builder to chain .With methods.

Applies to

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.

public static T WithCachePartitionKey<T>(this Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<T> builder, string key, string value, bool partitionRefreshToken) where T : Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<T>;
static member WithCachePartitionKey : Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<'T (requires 'T :> Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<'T>)> * string * string * bool -> 'T (requires 'T :> Microsoft.Identity.Client.BaseAbstractAcquireTokenParameterBuilder<'T>)
<Extension()>
Public Function WithCachePartitionKey(Of T As BaseAbstractAcquireTokenParameterBuilder(Of T)) (builder As BaseAbstractAcquireTokenParameterBuilder(Of T), key As String, value As String, partitionRefreshToken As Boolean) As T

Type Parameters

T

Parameters

builder
BaseAbstractAcquireTokenParameterBuilder<T>

The builder to chain .With methods.

key
String

The partition key name.

value
String

The partition key value.

partitionRefreshToken
Boolean

When true, the refresh token is also stored and looked up using the partition key. When false, only the access token is partitioned and the refresh token remains in the shared pool.

Returns

T

The builder to chain .With methods.

Applies to