Dela via


ClaimsRequest Class

  • java.lang.Object
    • com.microsoft.aad.msal4j.ClaimsRequest

public class ClaimsRequest

Represents the claims request parameter as an object

Constructor Summary

Constructor Description
ClaimsRequest()

Method Summary

Modifier and Type Method and Description
static ClaimsRequest formatAsClaimsRequest(String claims)

Creates an instance of ClaimsRequest from a JSON-formatted String which follows the specification for the OIDC claims request parameter

java.lang.String formatAsJSONString()

Converts the ClaimsRequest object to a JSON-formatted String which follows the specification for the OIDC claims request parameter

java.util.List<RequestedClaim> getIdTokenRequestedClaims()
protected void requestClaimInAccessToken(String claim, RequestedClaimAdditionalInfo requestedClaimAdditionalInfo)

Inserts a claim into the list of claims to be added to the "access_token" section of an OIDC claims request

void requestClaimInIdToken(String claim, RequestedClaimAdditionalInfo requestedClaimAdditionalInfo)

Inserts a claim into the list of claims to be added to the "id_token" section of an OIDC claims request

protected void requestClaimInUserInfo(String claim, RequestedClaimAdditionalInfo requestedClaimAdditionalInfo)

Inserts a claim into the list of claims to be added to the "userinfo" section of an OIDC claims request

void setIdTokenRequestedClaims(List<RequestedClaim> idTokenRequestedClaims)

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

Constructor Details

ClaimsRequest

public ClaimsRequest()

Method Details

formatAsClaimsRequest

public static ClaimsRequest formatAsClaimsRequest(String claims)

Creates an instance of ClaimsRequest from a JSON-formatted String which follows the specification for the OIDC claims request parameter

Parameters:

claims - a String following JSON formatting

Returns:

a ClaimsRequest instance

formatAsJSONString

public String formatAsJSONString()

Converts the ClaimsRequest object to a JSON-formatted String which follows the specification for the OIDC claims request parameter

Returns:

a String following JSON formatting

getIdTokenRequestedClaims

public List getIdTokenRequestedClaims()

requestClaimInAccessToken

protected void requestClaimInAccessToken(String claim, RequestedClaimAdditionalInfo requestedClaimAdditionalInfo)

Inserts a claim into the list of claims to be added to the "access_token" section of an OIDC claims request

Parameters:

claim - the name of the claim to be requested
requestedClaimAdditionalInfo - additional information about the claim being requested

requestClaimInIdToken

public void requestClaimInIdToken(String claim, RequestedClaimAdditionalInfo requestedClaimAdditionalInfo)

Inserts a claim into the list of claims to be added to the "id_token" section of an OIDC claims request

Parameters:

claim - the name of the claim to be requested
requestedClaimAdditionalInfo - additional information about the claim being requested

requestClaimInUserInfo

protected void requestClaimInUserInfo(String claim, RequestedClaimAdditionalInfo requestedClaimAdditionalInfo)

Inserts a claim into the list of claims to be added to the "userinfo" section of an OIDC claims request

Parameters:

claim - the name of the claim to be requested
requestedClaimAdditionalInfo - additional information about the claim being requested

setIdTokenRequestedClaims

public void setIdTokenRequestedClaims(List idTokenRequestedClaims)

Parameters:

idTokenRequestedClaims

Applies to