Class LogoutTokenClaimsSet
- java.lang.Object
-
- com.nimbusds.openid.connect.sdk.claims.ClaimsSet
-
- com.nimbusds.openid.connect.sdk.claims.LogoutTokenClaimsSet
-
- All Implemented Interfaces:
net.minidev.json.JSONAware
public class LogoutTokenClaimsSet extends ClaimsSet
Back-channel logout token claims set, serialisable to a JSON object.Example logout token claims set:
o { "iss" : "https://server.example.com", "sub" : "248289761001", "aud" : "s6BhdRkqt3", "iat" : 1471566154, "jti" : "bWJq", "sid" : "08a5019c-17e1-4977-8f42-65a12843ea02", "events" : { "http://schemas.openid.net/event/backchannel-logout": { } } }Related specifications:
- OpenID Connect Back-Channel Logout 1.0, section 2.4 (draft 04).
- Security Event Token (SET) (RFC 8417)
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUD_CLAIM_NAMEThe audience claim name.static StringEVENT_TYPEThe OpenID logout event type.static StringEVENTS_CLAIM_NAMEThe events claim name.static StringIAT_CLAIM_NAMEThe issue time claim name.static StringISS_CLAIM_NAMEThe issuer claim name.static StringJTI_CLAIM_NAMEThe JWT ID claim name.static StringSID_CLAIM_NAMEThe session identifier claim name.static StringSUB_CLAIM_NAMEThe subject claim name.
-
Constructor Summary
Constructors Constructor Description LogoutTokenClaimsSet(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)Creates a new logout token claims set from the specified JSON Web Token (JWT) claims set.LogoutTokenClaimsSet(Issuer iss, Subject sub, List<Audience> aud, Date iat, JWTID jti, SessionID sid)Creates a new logout token claims set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Audience>getAudience()Gets the audience.IssuergetIssuer()Gets the issuer.DategetIssueTime()Gets the issue time.JWTIDgetJWTID()Gets the JWT ID.SessionIDgetSessionID()Gets the session ID.static Set<String>getStandardClaimNames()Gets the names of the standard top-level logout token claims.SubjectgetSubject()Gets the subject.static LogoutTokenClaimsSetparse(String json)Parses a logout token claims set from the specified JSON object string.voidsetSessionID(SessionID sid)Sets the session ID.net.minidev.json.JSONObjecttoJSONObject()Gets the JSON object representation of this claims set.com.nimbusds.jwt.JWTClaimsSettoJWTClaimsSet()Gets the JSON Web Token (JWT) claims set for this claim set.-
Methods inherited from class com.nimbusds.openid.connect.sdk.claims.ClaimsSet
getBooleanClaim, getClaim, getClaim, getDateClaim, getEmailClaim, getLangTaggedClaim, getNumberClaim, getStringClaim, getStringClaim, getStringListClaim, getURIClaim, getURLClaim, putAll, putAll, setAudience, setAudience, setClaim, setClaim, setDateClaim, setEmailClaim, setIssuer, setURIClaim, setURLClaim, toJSONString
-
-
-
-
Field Detail
-
JTI_CLAIM_NAME
public static final String JTI_CLAIM_NAME
The JWT ID claim name.- See Also:
- Constant Field Values
-
EVENTS_CLAIM_NAME
public static final String EVENTS_CLAIM_NAME
The events claim name.- See Also:
- Constant Field Values
-
EVENT_TYPE
public static final String EVENT_TYPE
The OpenID logout event type.- See Also:
- Constant Field Values
-
ISS_CLAIM_NAME
public static final String ISS_CLAIM_NAME
The issuer claim name.- See Also:
- Constant Field Values
-
SUB_CLAIM_NAME
public static final String SUB_CLAIM_NAME
The subject claim name.- See Also:
- Constant Field Values
-
AUD_CLAIM_NAME
public static final String AUD_CLAIM_NAME
The audience claim name.- See Also:
- Constant Field Values
-
IAT_CLAIM_NAME
public static final String IAT_CLAIM_NAME
The issue time claim name.- See Also:
- Constant Field Values
-
SID_CLAIM_NAME
public static final String SID_CLAIM_NAME
The session identifier claim name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogoutTokenClaimsSet
public LogoutTokenClaimsSet(Issuer iss, Subject sub, List<Audience> aud, Date iat, JWTID jti, SessionID sid)
Creates a new logout token claims set. Either the subject or the session ID must be set, or both.- Parameters:
iss- The issuer. Must not benull.sub- The subject. Must not benullunless the session ID is set.aud- The audience. Must not benull.iat- The issue time. Must not benull.jti- The JWT ID. Must not benull.sid- The session ID. Must not benullunless the subject is set.
-
LogoutTokenClaimsSet
public LogoutTokenClaimsSet(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet) throws ParseException
Creates a new logout token claims set from the specified JSON Web Token (JWT) claims set.- Parameters:
jwtClaimsSet- The JWT claims set. Must not benull.- Throws:
ParseException- If the JWT claims set doesn't represent a valid logout token claims set.
-
-
Method Detail
-
getStandardClaimNames
public static Set<String> getStandardClaimNames()
Gets the names of the standard top-level logout token claims.- Returns:
- The names of the standard top-level logout token claims (read-only set).
-
getJWTID
public JWTID getJWTID()
Gets the JWT ID. Corresponds to thejticlaim.- Returns:
- The JWT ID.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Description copied from class:ClaimsSetGets the JSON object representation of this claims set.Example:
{ "country" : "USA", "country#en" : "USA", "country#de_DE" : "Vereinigte Staaten", "country#fr_FR" : "Etats Unis" }- Overrides:
toJSONObjectin classClaimsSet- Returns:
- The JSON object representation.
-
toJWTClaimsSet
public com.nimbusds.jwt.JWTClaimsSet toJWTClaimsSet() throws ParseException
Description copied from class:ClaimsSetGets the JSON Web Token (JWT) claims set for this claim set.- Overrides:
toJWTClaimsSetin classClaimsSet- Returns:
- The JWT claims set.
- Throws:
ParseException- If the conversion to a JWT claims set fails.
-
parse
public static LogoutTokenClaimsSet parse(String json) throws ParseException
Parses a logout token claims set from the specified JSON object string.- Parameters:
json- The JSON object string to parse. Must not benull.- Returns:
- The logout token claims set.
- Throws:
ParseException- If parsing failed.
-
getIssuer
public Issuer getIssuer()
Gets the issuer. Corresponds to theissclaim.
-
getSubject
public Subject getSubject()
Gets the subject. Corresponds to thesubclaim.- Returns:
- The subject.
-
getAudience
public List<Audience> getAudience()
Gets the audience. Corresponds to theaudclaim.- Overrides:
getAudiencein classClaimsSet- Returns:
- The audience,
nullif not specified.
-
getIssueTime
public Date getIssueTime()
Gets the issue time. Corresponds to theissclaim.- Returns:
- The issue time,
nullif not specified.
-
getSessionID
public SessionID getSessionID()
Gets the session ID. Corresponds to thesidclaim.- Returns:
- The session ID,
nullif not specified.
-
setSessionID
public void setSessionID(SessionID sid)
Sets the session ID. Corresponds to thesidclaim.- Parameters:
sid- The session ID,nullif not specified.
-
-