Table of Contents

Class AcquireTokenByAuthorizationCodeParameterBuilder

Namespace
Microsoft.Identity.Client
Assembly
Microsoft.Identity.Client.dll

Builder for AcquireTokenByAuthorizationCode

public sealed class AcquireTokenByAuthorizationCodeParameterBuilder : AbstractConfidentialClientAcquireTokenParameterBuilder<AcquireTokenByAuthorizationCodeParameterBuilder>
Inheritance
AcquireTokenByAuthorizationCodeParameterBuilder
Inherited Members
Extension Methods

Methods

Validate()

Validates the parameters of the AcquireToken operation.

protected override void Validate()

Exceptions

MsalClientException

WithCcsRoutingHint(string)

To help with resiliency, the AAD backup authentication system operates as an AAD backup. This will provide backup authentication system with a routing hint to help improve performance during authentication.

public AcquireTokenByAuthorizationCodeParameterBuilder WithCcsRoutingHint(string userName)

Parameters

userName string

Identifier of the user. Generally in UserPrincipalName (UPN) format, e.g. john.doe@contoso.com

Returns

AcquireTokenByAuthorizationCodeParameterBuilder

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 backup authentication system with a routing hint to help improve performance during authentication.

public AcquireTokenByAuthorizationCodeParameterBuilder WithCcsRoutingHint(string userObjectIdentifier, string tenantIdentifier)

Parameters

userObjectIdentifier string

GUID which is unique to the user, parsed from the client_info.

tenantIdentifier string

GUID format of the tenant ID, parsed from the client_info.

Returns

AcquireTokenByAuthorizationCodeParameterBuilder

The builder to chain the .With methods

WithPkceCodeVerifier(string)

Used to secure authorization code grant via Proof of Key for Code Exchange (PKCE). See (https://tools.ietf.org/html/rfc7636) for more details.

public AcquireTokenByAuthorizationCodeParameterBuilder WithPkceCodeVerifier(string pkceCodeVerifier)

Parameters

pkceCodeVerifier string

A dynamically created cryptographically random key used to provide proof of possession for the authorization code.

Returns

AcquireTokenByAuthorizationCodeParameterBuilder

The builder to chain the .With methods

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 AcquireTokenByAuthorizationCodeParameterBuilder WithSendX5C(bool withSendX5C)

Parameters

withSendX5C bool

true if the x5c should be sent. Otherwise false. The default is false

Returns

AcquireTokenByAuthorizationCodeParameterBuilder

The builder to chain the .With methods

WithSpaAuthorizationCode(bool)

Requests an auth code for the frontend (SPA using MSAL.js for instance). See https://aka.ms/msal-net/spa-auth-code for details.

public AcquireTokenByAuthorizationCodeParameterBuilder WithSpaAuthorizationCode(bool requestSpaAuthorizationCode = true)

Parameters

requestSpaAuthorizationCode bool

Returns

AcquireTokenByAuthorizationCodeParameterBuilder

The builder to chain the .With methods