ClientCredentialParameters.ClientCredentialParametersBuilder Class

  • java.lang.Object
    • com.microsoft.aad.msal4j.ClientCredentialParameters.ClientCredentialParametersBuilder

public static class ClientCredentialParameters.ClientCredentialParametersBuilder

Method Summary

Modifier and Type Method and Description
ClientCredentialParameters build()
ClientCredentialParametersBuilder claims(ClaimsRequest claims)

Claims to be requested through the OIDC claims request parameter, allowing requests for standard and custom claims

ClientCredentialParametersBuilder claimsFromClient(String claimsJson)

Specifies client-originated claims (a raw JSON object string) to forward to the token endpoint as the OAuth claims request parameter.

ClientCredentialParametersBuilder clientCredential(IClientCredential clientCredential)

Overrides the client credentials for this request

ClientCredentialParametersBuilder extraHttpHeaders(Map<String,String> extraHttpHeaders)

Adds additional headers to the token request

ClientCredentialParametersBuilder 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

ClientCredentialParametersBuilder fmiPath(String fmiPath)

Sets the FMI (Federated Managed Identity) path for agent identity scenarios.

ClientCredentialParametersBuilder scopes(Set<String> scopes)

Scopes application is requesting access to.

ClientCredentialParametersBuilder skipCache(Boolean skipCache)

Indicates whether the request should skip looking into the token cache.

ClientCredentialParametersBuilder tenant(String tenant)

Overrides the tenant value in the authority URL for this request

java.lang.String toString()

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

build

public ClientCredentialParameters build()

claims

public ClientCredentialParameters.ClientCredentialParametersBuilder claims(ClaimsRequest claims)

Claims to be requested through the OIDC claims request parameter, allowing requests for standard and custom claims

Parameters:

claims

claimsFromClient

public ClientCredentialParameters.ClientCredentialParametersBuilder 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.

Parameters:

claimsJson - a valid JSON object string containing the client claims

Returns:

builder that can be used to construct ClientCredentialParameters

clientCredential

public ClientCredentialParameters.ClientCredentialParametersBuilder clientCredential(IClientCredential clientCredential)

Overrides the client credentials for this request

Parameters:

clientCredential

extraHttpHeaders

public ClientCredentialParameters.ClientCredentialParametersBuilder extraHttpHeaders(Map<String,String> extraHttpHeaders)

Adds additional headers to the token request

Parameters:

extraHttpHeaders

extraQueryParameters


public ClientCredentialParameters.ClientCredentialParametersBuilder 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

Parameters:

extraQueryParameters

fmiPath

public ClientCredentialParameters.ClientCredentialParametersBuilder fmiPath(String fmiPath)

Sets the FMI (Federated Managed Identity) path for agent identity scenarios. When set, fmi_path is sent as a body parameter in the client credentials token request, which tells Entra ID to scope the resulting token to a specific agent identity. The token is also cached with an extended cache key to prevent collisions between tokens for different agent identities.

Parameters:

fmiPath - the FMI path value (typically the agent application ID)

Returns:

builder that can be used to construct ClientCredentialParameters

scopes

public ClientCredentialParameters.ClientCredentialParametersBuilder scopes(Set<String> scopes)

Scopes application is requesting access to.

Cannot be null.

Parameters:

scopes

skipCache

public ClientCredentialParameters.ClientCredentialParametersBuilder skipCache(Boolean skipCache)

Indicates whether the request should skip looking into the token cache. Be default it is set to false.

Parameters:

skipCache

tenant

public ClientCredentialParameters.ClientCredentialParametersBuilder tenant(String tenant)

Overrides the tenant value in the authority URL for this request

Parameters:

tenant

toString

public String toString()

Overrides:

ClientCredentialParameters.ClientCredentialParametersBuilder.toString()

Applies to