public class ClaimsRequest extends Object
Related specifications:
| Modifier and Type | Class and Description |
|---|---|
static class |
ClaimsRequest.Entry
Individual claim request.
|
| Constructor and Description |
|---|
ClaimsRequest()
Creates a new empty claims request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ClaimsRequest other)
Adds the entries from the specified other claims request.
|
void |
addIDTokenClaim(ClaimsRequest.Entry entry)
Adds the specified ID token claim to the request.
|
void |
addIDTokenClaim(String claimName)
Adds the specified ID token claim to the request.
|
void |
addIDTokenClaim(String claimName,
ClaimRequirement requirement)
Adds the specified ID token claim to the request.
|
void |
addIDTokenClaim(String claimName,
ClaimRequirement requirement,
com.nimbusds.langtag.LangTag langTag)
Adds the specified ID token claim to the request.
|
void |
addIDTokenClaim(String claimName,
ClaimRequirement requirement,
com.nimbusds.langtag.LangTag langTag,
List<String> values)
Adds the specified ID token claim to the request.
|
void |
addIDTokenClaim(String claimName,
ClaimRequirement requirement,
com.nimbusds.langtag.LangTag langTag,
String value)
Adds the specified ID token claim to the request.
|
void |
addUserInfoClaim(ClaimsRequest.Entry entry)
Adds the specified UserInfo claim to the request.
|
void |
addUserInfoClaim(String claimName)
Adds the specified UserInfo claim to the request.
|
void |
addUserInfoClaim(String claimName,
ClaimRequirement requirement)
Adds the specified UserInfo claim to the request.
|
void |
addUserInfoClaim(String claimName,
ClaimRequirement requirement,
com.nimbusds.langtag.LangTag langTag)
Adds the specified UserInfo claim to the request.
|
void |
addUserInfoClaim(String claimName,
ClaimRequirement requirement,
com.nimbusds.langtag.LangTag langTag,
List<String> values)
Adds the specified UserInfo claim to the request.
|
void |
addUserInfoClaim(String claimName,
ClaimRequirement requirement,
com.nimbusds.langtag.LangTag langTag,
String value)
Adds the specified UserInfo claim to the request.
|
static ClaimsRequest |
forScope(Scope scope)
Gets the claims request for the specified scope.
|
Set<String> |
getIDTokenClaimNames(boolean withLangTag)
Gets the names of the requested ID token claim names.
|
Collection<ClaimsRequest.Entry> |
getIDTokenClaims()
Gets the requested ID token claims.
|
Set<String> |
getUserInfoClaimNames(boolean withLangTag)
Gets the names of the requested UserInfo claim names.
|
Collection<ClaimsRequest.Entry> |
getUserInfoClaims()
Gets the requested UserInfo claims.
|
static ClaimsRequest |
parse(net.minidev.json.JSONObject jsonObject)
Parses a claims request from the specified JSON object
representation.
|
ClaimsRequest.Entry |
removeIDTokenClaim(String claimName,
com.nimbusds.langtag.LangTag langTag)
Removes the specified ID token claim from the request.
|
Collection<ClaimsRequest.Entry> |
removeIDTokenClaims(String claimName)
Removes the specified ID token claims from the request, in all
existing language tag variations.
|
ClaimsRequest.Entry |
removeUserInfoClaim(String claimName,
com.nimbusds.langtag.LangTag langTag)
Removes the specified UserInfo claim from the request.
|
Collection<ClaimsRequest.Entry> |
removeUserInfoClaims(String claimName)
Removes the specified UserInfo claims from the request, in all
existing language tag variations.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns the JSON object representation of this claims request.
|
String |
toString() |
public ClaimsRequest()
public void add(ClaimsRequest other)
other - The other claims request. If null no claims
request entries will be added to this claims request.public void addIDTokenClaim(String claimName)
claimName - The claim name. Must not be null.public void addIDTokenClaim(String claimName, ClaimRequirement requirement)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.public void addIDTokenClaim(String claimName, ClaimRequirement requirement, com.nimbusds.langtag.LangTag langTag)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.langTag - The associated language tag, null if not
specified.public void addIDTokenClaim(String claimName, ClaimRequirement requirement, com.nimbusds.langtag.LangTag langTag, String value)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.langTag - The associated language tag, null if not
specified.value - The expected claim value, null if not
specified.public void addIDTokenClaim(String claimName, ClaimRequirement requirement, com.nimbusds.langtag.LangTag langTag, List<String> values)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.langTag - The associated language tag, null if not
specified.values - The expected claim values, null if not
specified.public void addIDTokenClaim(ClaimsRequest.Entry entry)
entry - The individual ID token claim request. Must not be
null.public Collection<ClaimsRequest.Entry> getIDTokenClaims()
public Set<String> getIDTokenClaimNames(boolean withLangTag)
withLangTag - If true the language tags, if any, will
be appended to the names, else not.public ClaimsRequest.Entry removeIDTokenClaim(String claimName, com.nimbusds.langtag.LangTag langTag)
claimName - The claim name. Must not be null.langTag - The associated language tag, null if none.null if not found.public Collection<ClaimsRequest.Entry> removeIDTokenClaims(String claimName)
claimName - The claim name. Must not be null.public void addUserInfoClaim(String claimName)
claimName - The claim name. Must not be null.public void addUserInfoClaim(String claimName, ClaimRequirement requirement)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.public void addUserInfoClaim(String claimName, ClaimRequirement requirement, com.nimbusds.langtag.LangTag langTag)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.langTag - The associated language tag, null if not
specified.public void addUserInfoClaim(String claimName, ClaimRequirement requirement, com.nimbusds.langtag.LangTag langTag, String value)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.langTag - The associated language tag, null if not
specified.value - The expected claim value, null if not
specified.public void addUserInfoClaim(String claimName, ClaimRequirement requirement, com.nimbusds.langtag.LangTag langTag, List<String> values)
claimName - The claim name. Must not be null.requirement - The claim requirement. Must not be null.langTag - The associated language tag, null if not
specified.values - The expected claim values, null if not
specified.public void addUserInfoClaim(ClaimsRequest.Entry entry)
entry - The individual UserInfo claim request. Must not be
null.public Collection<ClaimsRequest.Entry> getUserInfoClaims()
public Set<String> getUserInfoClaimNames(boolean withLangTag)
withLangTag - If true the language tags, if any, will
be appended to the names, else not.public ClaimsRequest.Entry removeUserInfoClaim(String claimName, com.nimbusds.langtag.LangTag langTag)
claimName - The claim name. Must not be null.langTag - The associated language tag, null if none.null if not found.public Collection<ClaimsRequest.Entry> removeUserInfoClaims(String claimName)
claimName - The claim name. Must not be null.public net.minidev.json.JSONObject toJSONObject()
Example:
{
"userinfo":
{
"given_name": {"essential": true},
"nickname": null,
"email": {"essential": true},
"email_verified": {"essential": true},
"picture": null,
"http://example.info/claims/groups": null
},
"id_token":
{
"auth_time": {"essential": true},
"acr": {"values": ["urn:mace:incommon:iap:silver"] }
}
}
public static ClaimsRequest forScope(Scope scope)
standard OpenID Connect scope values
are resolved to their respective individual claims requests, any
other scope values are ignored.scope - The scope. Must not be null.public static ClaimsRequest parse(net.minidev.json.JSONObject jsonObject)
jsonObject - The JSON object to parse. Must not be
null.Copyright © 2013 NimbusDS. All Rights Reserved.