Class AcquireTokenOnBehalfOfParameterBuilder
Builder for AcquireTokenOnBehalfOf (OBO flow) See https://aka.ms/msal-net-on-behalf-of
public sealed class AcquireTokenOnBehalfOfParameterBuilder : AbstractConfidentialClientAcquireTokenParameterBuilder<AcquireTokenOnBehalfOfParameterBuilder>
- Inheritance
-
AcquireTokenOnBehalfOfParameterBuilder
- Inherited Members
- Extension Methods
Methods
Validate()
Validates the parameters of the AcquireToken operation.
protected override void Validate()
Exceptions
WithCcsRoutingHint(string)
To help with resiliency, the AAD backup authentication system operates as an AAD backup. This will provide the AAD backup authentication system with a routing hint to help improve performance during authentication.
public AcquireTokenOnBehalfOfParameterBuilder WithCcsRoutingHint(string userName)
Parameters
userName
stringIdentifier of the user. Generally in UserPrincipalName (UPN) format, e.g.
john.doe@contoso.com
Returns
- AcquireTokenOnBehalfOfParameterBuilder
The builder to chain the .With methods
WithCcsRoutingHint(string, string)
To help with resiliency, the AAD backup authentication system operates as an AAD backup. This will provide the AAD backup authentication system with a routing hint to help improve performance during authentication.
public AcquireTokenOnBehalfOfParameterBuilder WithCcsRoutingHint(string userObjectIdentifier, string tenantIdentifier)
Parameters
userObjectIdentifier
stringGUID which is unique to the user, parsed from the client_info.
tenantIdentifier
stringGUID format of the tenant ID, parsed from the client_info.
Returns
- AcquireTokenOnBehalfOfParameterBuilder
The builder to chain the .With methods
WithForceRefresh(bool)
Specifies if the client application should ignore access tokens when reading the token cache. New tokens will still be written to the token cache. By default the token is taken from the the user token cache (forceRefresh=false)
public AcquireTokenOnBehalfOfParameterBuilder WithForceRefresh(bool forceRefresh)
Parameters
forceRefresh
boolIf
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. The default isfalse
Returns
- AcquireTokenOnBehalfOfParameterBuilder
The builder to chain the .With methods
Remarks
Do not use this flag except in well understood cases. Identity Providers will throttle clients that issue 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 AcquireTokenOnBehalfOfParameterBuilder WithSendX5C(bool withSendX5C)
Parameters
withSendX5C
booltrue
if the x5c should be sent. Otherwisefalse
. The default isfalse
Returns
- AcquireTokenOnBehalfOfParameterBuilder
The builder to chain the .With methods