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 String
AUD_CLAIM_NAME
The audience claim name.static String
EVENT_TYPE
The OpenID logout event type.static String
EVENTS_CLAIM_NAME
The events claim name.static String
IAT_CLAIM_NAME
The issue time claim name.static String
ISS_CLAIM_NAME
The issuer claim name.static String
JTI_CLAIM_NAME
The JWT ID claim name.static String
SID_CLAIM_NAME
The session identifier claim name.static String
SUB_CLAIM_NAME
The 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.Issuer
getIssuer()
Gets the issuer.Date
getIssueTime()
Gets the issue time.JWTID
getJWTID()
Gets the JWT ID.SessionID
getSessionID()
Gets the session ID.static Set<String>
getStandardClaimNames()
Gets the names of the standard top-level logout token claims.Subject
getSubject()
Gets the subject.static LogoutTokenClaimsSet
parse(String json)
Parses a logout token claims set from the specified JSON object string.void
setSessionID(SessionID sid)
Sets the session ID.net.minidev.json.JSONObject
toJSONObject()
Gets the JSON object representation of this claims set.com.nimbusds.jwt.JWTClaimsSet
toJWTClaimsSet()
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 benull
unless 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 benull
unless 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 thejti
claim.- Returns:
- The JWT ID.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Description copied from class:ClaimsSet
Gets 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:
toJSONObject
in classClaimsSet
- Returns:
- The JSON object representation.
-
toJWTClaimsSet
public com.nimbusds.jwt.JWTClaimsSet toJWTClaimsSet() throws ParseException
Description copied from class:ClaimsSet
Gets the JSON Web Token (JWT) claims set for this claim set.- Overrides:
toJWTClaimsSet
in 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 theiss
claim.
-
getSubject
public Subject getSubject()
Gets the subject. Corresponds to thesub
claim.- Returns:
- The subject.
-
getAudience
public List<Audience> getAudience()
Gets the audience. Corresponds to theaud
claim.- Overrides:
getAudience
in classClaimsSet
- Returns:
- The audience,
null
if not specified.
-
getIssueTime
public Date getIssueTime()
Gets the issue time. Corresponds to theiss
claim.- Returns:
- The issue time,
null
if not specified.
-
getSessionID
public SessionID getSessionID()
Gets the session ID. Corresponds to thesid
claim.- Returns:
- The session ID,
null
if not specified.
-
setSessionID
public void setSessionID(SessionID sid)
Sets the session ID. Corresponds to thesid
claim.- Parameters:
sid
- The session ID,null
if not specified.
-
-