Class AcquireTokenForClientParameterBuilder
Builder for AcquireTokenForClient (used in client credential flows, in daemon applications). See https://aka.ms/msal-net-client-credentials
public sealed class AcquireTokenForClientParameterBuilder : AbstractConfidentialClientAcquireTokenParameterBuilder<AcquireTokenForClientParameterBuilder>
- Inheritance
-
AcquireTokenForClientParameterBuilder
- Inherited Members
- Extension Methods
Methods
Validate()
Validates the parameters of the AcquireToken operation.
protected override void Validate()
Exceptions
WithForceRefresh(bool)
Specifies if the client application should ignore access tokens when reading the token cache. New tokens will still be written to the application token cache. By default the token is taken from the application token cache (forceRefresh=false)
public AcquireTokenForClientParameterBuilder WithForceRefresh(bool forceRefresh)
Parameters
forceRefresh
boolIf
true
, the request will ignore cached access tokens on read, but will still write them to the cache once obtained from the identity provider. The default isfalse
Returns
- AcquireTokenForClientParameterBuilder
The builder to chain the .With methods
Remarks
Do not use this flag except in well understood cases. Identity providers will throttle clients that make too many similar token requests.
WithSendX5C(bool)
Applicable to first-party applications only, this method also allows to specify if the x5c claim should be sent to Azure AD. Sending the x5c enables application developers to achieve easy certificate roll-over in Azure AD: this method will send the certificate chain to Azure AD along with the token request, so that Azure AD can use it to validate the subject name based on a trusted issuer policy. This saves the application admin from the need to explicitly manage the certificate rollover (either via portal or PowerShell/CLI operation). For details see https://aka.ms/msal-net-sni
public AcquireTokenForClientParameterBuilder WithSendX5C(bool withSendX5C)
Parameters
withSendX5C
booltrue
if the x5c should be sent. Otherwisefalse
. The default isfalse
Returns
- AcquireTokenForClientParameterBuilder
The builder to chain the .With methods