Class 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)
    • 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 be null.
        sub - The subject. Must not be null unless the session ID is set.
        aud - The audience. Must not be null.
        iat - The issue time. Must not be null.
        jti - The JWT ID. Must not be null.
        sid - The session ID. Must not be null 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 be null.
        Throws:
        ParseException - If the JWT claims set doesn't represent a valid logout token claims set.
    • Method Detail

      • getStandardClaimNames

        public static Set<StringgetStandardClaimNames()
        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 the jti 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 class ClaimsSet
        Returns:
        The JSON object representation.
      • 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 be null.
        Returns:
        The logout token claims set.
        Throws:
        ParseException - If parsing failed.
      • getIssuer

        public Issuer getIssuer()
        Gets the issuer. Corresponds to the iss claim.
        Overrides:
        getIssuer in class ClaimsSet
        Returns:
        The issuer, null if not specified.
      • getSubject

        public Subject getSubject()
        Gets the subject. Corresponds to the sub claim.
        Returns:
        The subject.
      • getAudience

        public List<Audience> getAudience()
        Gets the audience. Corresponds to the aud claim.
        Overrides:
        getAudience in class ClaimsSet
        Returns:
        The audience, null if not specified.
      • getIssueTime

        public Date getIssueTime()
        Gets the issue time. Corresponds to the iss claim.
        Returns:
        The issue time, null if not specified.
      • getSessionID

        public SessionID getSessionID()
        Gets the session ID. Corresponds to the sid claim.
        Returns:
        The session ID, null if not specified.
      • setSessionID

        public void setSessionID​(SessionID sid)
        Sets the session ID. Corresponds to the sid claim.
        Parameters:
        sid - The session ID, null if not specified.