Share via


AcquireTokenSilentParameterBuilder.WithForceRefresh(Boolean) Method

Definition

Specifies if the client application should ignore access tokens when reading the token cache. Refresh tokens will still be used. Any new tokens from the Identity Provider will still be written to the token cache. By default the token is taken from the the user token cache (forceRefresh=false)

public Microsoft.Identity.Client.AcquireTokenSilentParameterBuilder WithForceRefresh (bool forceRefresh);
member this.WithForceRefresh : bool -> Microsoft.Identity.Client.AcquireTokenSilentParameterBuilder
Public Function WithForceRefresh (forceRefresh As Boolean) As AcquireTokenSilentParameterBuilder

Parameters

forceRefresh
Boolean

If true, ignore any access token in the user token cache and attempt to acquire new access token using the refresh token for the account if one is available. This can be useful in the case when the application developer wants to make sure that conditional access policies are applied immediately, rather than after the expiration of the access token. The default is false

Returns

The builder to chain the .With methods

Remarks

Avoid unnecessarily setting forceRefresh to true true in order to avoid negatively affecting the performance of your application

Applies to