AuthorizationCodeParameters.AuthorizationCodeParametersBuilder Class
- java.
lang. Object - com.
microsoft. aad. msal4j. AuthorizationCodeParameters. AuthorizationCodeParametersBuilder
- com.
public static class AuthorizationCodeParameters.AuthorizationCodeParametersBuilder
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Authorization |
authorizationCode(String authorizationCode)
Authorization code acquired in the first step of OAuth2.0 authorization code flow. |
|
Authorization |
build() |
|
Authorization |
claims(ClaimsRequest claims)
Claims to be requested through the OIDC claims request parameter, allowing requests for standard and custom claims |
|
Authorization |
claimsFromClient(String claimsJson)
Specifies client-originated claims (a raw JSON object string) to forward to the token endpoint as the OAuth |
|
Authorization |
codeVerifier(String codeVerifier)
Code verifier used for PKCE. |
|
Authorization |
extraHttpHeaders(Map<String,String> extraHttpHeaders)
Adds additional headers to the token request |
|
Authorization |
extraQueryParameters(Map<String,String> extraQueryParameters)
Deprecated
Not recommended for production scenarios. It will be removed in a future release, and the behavior may be replaced by a new API.
Adds additional query parameters to the token request |
|
Authorization |
redirectUri(URI redirectUri)
Redirect URI registered in the Azure portal, and which was used in the first step of OAuth2.0 authorization code flow. |
|
Authorization |
scopes(Set<String> scopes)
Scopes to which the application is requesting access |
|
Authorization |
tenant(String tenant)
Overrides the tenant value in the authority URL for this request |
| java.lang.String | toString() |
Methods inherited from java.lang.Object
Method Details
authorizationCode
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder authorizationCode(String authorizationCode)
Authorization code acquired in the first step of OAuth2.0 authorization code flow. For more details, see https://aka.ms/msal4j-authorization-code-flow
Cannot be null.
Parameters:
build
public AuthorizationCodeParameters build()
claims
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder claims(ClaimsRequest claims)
Claims to be requested through the OIDC claims request parameter, allowing requests for standard and custom claims
Parameters:
claimsFromClient
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder claimsFromClient(String claimsJson)
Specifies client-originated claims (a raw JSON object string) to forward to the token endpoint as the OAuth claims request parameter. Unlike claims(ClaimsRequest claims) (server-issued claims challenges, which bypass the cache), tokens acquired with client claims are cached and the cache entry is keyed on the claims value, so distinct claim values produce separate cache entries. Use stable, non-dynamic values to avoid cache fragmentation. Send the identical value on every request for a given token; because the raw value is part of the cache key, changing or omitting it routes the request to a different cache partition. A blank value is ignored; an invalid JSON object throws MsalClientException.
Client claims are primarily intended for confidential-client web apps, but AuthorizationCodeParameters is also accepted by PublicClientApplication, so this method is visible there too. The same cache caveat applies to both application types: a token acquired with client claims is stored under the extended cache key, while a later acquireTokenSilently call (which uses SilentParameters and cannot carry client claims) will not match that entry and will instead refresh without the client claims. The claims are applied only on the acquire/redemption call that sets them; to apply them again, redeem through this builder rather than relying on a silent refresh.
Parameters:
Returns:
codeVerifier
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder codeVerifier(String codeVerifier)
Code verifier used for PKCE. For more details, see https://tools.ietf.org/html/rfc7636
Parameters:
extraHttpHeaders
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder extraHttpHeaders(Map<String,String> extraHttpHeaders)
Adds additional headers to the token request
Parameters:
extraQueryParameters
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder extraQueryParameters(Map<String,String> extraQueryParameters)
Deprecated
Adds additional query parameters to the token request
Parameters:
redirectUri
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder redirectUri(URI redirectUri)
Redirect URI registered in the Azure portal, and which was used in the first step of OAuth2.0 authorization code flow. For more details, see https://aka.ms/msal4j-authorization-code-flow
Cannot be null.
Parameters:
scopes
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder scopes(Set<String> scopes)
Scopes to which the application is requesting access
Parameters:
tenant
public AuthorizationCodeParameters.AuthorizationCodeParametersBuilder tenant(String tenant)
Overrides the tenant value in the authority URL for this request
Parameters:
toString
public String toString()
Overrides:
AuthorizationCodeParameters.AuthorizationCodeParametersBuilder.toString()