com.nimbusds.openid.connect.sdk
Class ClaimsRequest

java.lang.Object
  extended by com.nimbusds.openid.connect.sdk.ClaimsRequest
Direct Known Subclasses:
IDTokenClaimsRequest, UserInfoClaimsRequest

public abstract class ClaimsRequest
extends Object

Base abstract class for resolved ID Token and UserInfo claim requests.

Used to return the following resolved claims request information:

The underlying resolved claims request as a JSON object can be retrieved with the getRequestedClaimsObject() method.

Related specifications:

Version:
$version$ (2013-01-21)
Author:
Vladimir Dzhuvinov

Field Summary
protected  net.minidev.json.JSONObject requestedClaims
          Claims requested by the client that the authorisation server may choose to provide with the response according to policy and end-user consent.
protected  Set<String> requiredClaims
          Claims that the authorisation server must provide with the response.
 
Constructor Summary
protected ClaimsRequest()
          Creates a new claims request.
 
Method Summary
 Set<String> getClaimNames()
          Gets all claims requested by the client (essential and voluntary).
 net.minidev.json.JSONObject getRequestedClaimsObject()
          Gets the resolved JSON object representing the claims requested by the client.
 Set<String> getRequestedEssentialClaims()
          Gets those claims requested by the client that are marked as essential.
 Set<String> getRequestedVoluntaryClaims()
          Gets those claims requested by the client that are marked as voluntary.
 Set<String> getRequiredClaims()
          Gets the required claims that the authorisation server must provide with the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requiredClaims

protected Set<String> requiredClaims
Claims that the authorisation server must provide with the response.


requestedClaims

protected net.minidev.json.JSONObject requestedClaims
Claims requested by the client that the authorisation server may choose to provide with the response according to policy and end-user consent. These may be marked as essential or voluntary according to OpenID Connect Messages 2.1.1.1.3.

Constructor Detail

ClaimsRequest

protected ClaimsRequest()
Creates a new claims request. The requiredClaims field is set to a new empty set. The requestedClaims field is set to a new empty JSON object.

Method Detail

getRequiredClaims

public Set<String> getRequiredClaims()
Gets the required claims that the authorisation server must provide with the response.

Returns:
The names of the required claims, as a read-only set.

getRequestedClaimsObject

public net.minidev.json.JSONObject getRequestedClaimsObject()
Gets the resolved JSON object representing the claims requested by the client. The JSON object has the format of the "claims" member of an OpenID Connect request object. It can specify claims marked as essential or voluntary according to OpenID Connect Messages 2.1.1.1.3.

Example resolved UserInfo claims request:

 {
   "name"           : { "essential" : true },
   "nickname"       : null,
   "email"          : { "essential" : true },
   "email_verified" : { "essential" : true },
   "picture"        : null
 }
 

Example resolved ID Token claims request:

 {
   "auth_time" : { "essential": true },
   "acr"       : { "values":["2"] }
 }
 

Returns:
The requested claims JSON object.

getRequestedEssentialClaims

public Set<String> getRequestedEssentialClaims()
Gets those claims requested by the client that are marked as essential. Claims marked as essential by the client indicate that they are required for providing the service requested by the end-user.

Returns:
The names of the requested essential claims, as a read-only set, empty set if none.

getRequestedVoluntaryClaims

public Set<String> getRequestedVoluntaryClaims()
Gets those claims requested by the client that are marked as voluntary. Claims marked as voluntary are used to perform non-essential tasks offered to the end-user.

Returns:
The names of the requested voluntary claims, as a read-only set, empty set if none.

getClaimNames

public Set<String> getClaimNames()
Gets all claims requested by the client (essential and voluntary).

Returns:
The names of all requested claims (essential and voluntary), as a read-only set, empty set if none.


Copyright © 2013 NimbusDS. All Rights Reserved.