Class LogoutTokenClaimsSet
- java.lang.Object
-
- com.nimbusds.openid.connect.sdk.claims.ClaimsSet
-
- com.nimbusds.openid.connect.sdk.claims.CommonClaimsSet
-
- com.nimbusds.openid.connect.sdk.claims.LogoutTokenClaimsSet
-
- All Implemented Interfaces:
net.minidev.json.JSONAware
public class LogoutTokenClaimsSet extends CommonClaimsSet
Back-channel logout token claims set, serialisable to a JSON object.Example logout token claims set:
{ "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 StringEVENT_TYPEThe OpenID logout event type.static StringEVENTS_CLAIM_NAMEThe events claim name.static StringJTI_CLAIM_NAMEThe JWT ID claim name.static StringSID_CLAIM_NAMEThe session identifier claim name.-
Fields inherited from class com.nimbusds.openid.connect.sdk.claims.CommonClaimsSet
IAT_CLAIM_NAME, SUB_CLAIM_NAME
-
Fields inherited from class com.nimbusds.openid.connect.sdk.claims.ClaimsSet
AUD_CLAIM_NAME, claims, ISS_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 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.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.CommonClaimsSet
getIssueTime, getSubject
-
Methods inherited from class com.nimbusds.openid.connect.sdk.claims.ClaimsSet
equals, getAudience, getBooleanClaim, getClaim, getClaim, getDateClaim, getIssuer, getJSONObjectClaim, getLangTaggedClaim, getNumberClaim, getStringClaim, getStringClaim, getStringListClaim, getURIClaim, getURLClaim, hashCode, putAll, putAll, setAudience, setAudience, setClaim, setClaim, setDateClaim, 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
-
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.
-
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.
-
-