Class ClaimsSetRequest
java.lang.Object
com.nimbusds.openid.connect.sdk.claims.ClaimsSetRequest
- All Implemented Interfaces:
net.minidev.json.JSONAware
- Direct Known Subclasses:
VerifiedClaimsSetRequest,VerifiedClaimsSetRequest
OpenID Connect claims set request, intended to represent the
userinfo and id_token elements in a
claims request
parameter.
Example:
{
"given_name": {"essential": true},
"nickname": null,
"email": {"essential": true},
"email_verified": {"essential": true},
"picture": null,
"http://example.info/claims/groups": null
}
Related specifications:
- OpenID Connect Core 1.0, section 5.5.
- OpenID Connect for Identity Assurance 1.0.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIndividual OpenID claim request. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty OpenID Connect claims set request.ClaimsSetRequest(Collection<ClaimsSetRequest.Entry> entries) Creates a new OpenID Connect claims set request. -
Method Summary
Modifier and TypeMethodDescriptionadd(ClaimsSetRequest.Entry entry) Adds the specified claim to the request.Adds the specified claim to the request, using default settings.Deletes the specified claim from this request, in all existing language tag variations if any.Deletes the specified claim from this request.Gets the specified claim entry from this request.Gets the specified claim entry from this request.getClaimNames(boolean withLangTag) Gets the names of the requested claims.Gets the request entries.static ClaimsSetRequestParses an OpenID Connect claims set request from the specified JSON object string representation.static ClaimsSetRequestparse(net.minidev.json.JSONObject jsonObject) Parses an OpenID Connect claims set request from the specified JSON object representation.net.minidev.json.JSONObjectReturns the JSON object representation of this claims set request.toString()
-
Constructor Details
-
ClaimsSetRequest
public ClaimsSetRequest()Creates a new empty OpenID Connect claims set request. -
ClaimsSetRequest
Creates a new OpenID Connect claims set request.- Parameters:
entries- The request entries, empty collection if none. Must not benull.
-
-
Method Details
-
add
Adds the specified claim to the request, using default settings. Shorthand foradd(Entry).- Parameters:
claimName- The claim name. Must not benull.- Returns:
- The updated claims set request.
-
add
Adds the specified claim to the request.- Parameters:
entry- The individual claim request. Must not benull.- Returns:
- The updated claims set request.
-
getEntries
Gets the request entries.- Returns:
- The request entries, empty collection if none.
-
getClaimNames
Gets the names of the requested claims.- Parameters:
withLangTag- Iftruethe language tags, if any, will be appended to the names, else not.- Returns:
- The claim names, as an unmodifiable set, empty set if none.
-
get
Gets the specified claim entry from this request.- Parameters:
claimName- The claim name. Must not benull.- Returns:
- The claim entry,
nullif not found.
-
get
Gets the specified claim entry from this request.- Parameters:
claimName- The claim name. Must not benull.langTag- The associated language tag,nullif none.- Returns:
- The claim entry,
nullif not found.
-
delete
Deletes the specified claim from this request.- Parameters:
claimName- The claim name. Must not benull.langTag- The associated language tag,nullif none.- Returns:
- The updated claims set request.
-
delete
Deletes the specified claim from this request, in all existing language tag variations if any.- Parameters:
claimName- The claim name. Must not benull.- Returns:
- The updated claims set request.
-
toJSONObject
Returns the JSON object representation of this claims set request.Example:
{ "given_name": {"essential": true}, "nickname": null, "email": {"essential": true}, "email_verified": {"essential": true}, "picture": null, "http://example.info/claims/groups": null }- Returns:
- The JSON object, empty if no claims are specified.
-
toJSONString
- Specified by:
toJSONStringin interfacenet.minidev.json.JSONAware
-
toString
-
parse
Parses an OpenID Connect claims set request from the specified JSON object representation.- Parameters:
jsonObject- The JSON object to parse. Must not benull.- Returns:
- The claims set request.
- Throws:
ParseException- If parsing failed.
-
parse
Parses an OpenID Connect claims set request from the specified JSON object string representation.- Parameters:
json- The JSON object string to parse. Must not benull.- Returns:
- The claims set request.
- Throws:
ParseException- If parsing failed.
-