Class JsonWebToken

    • Constructor Detail

      • JsonWebToken

        public JsonWebToken()
    • Method Detail

      • getId

        public String getId()
      • getExp

        public Long getExp()
      • getExpiration

        public int getExpiration()
        int will overflow with values after 2038. Use getExp() instead.
      • expiration

        public JsonWebToken expiration​(int expiration)
        int will overflow with values after 2038. Use exp(Long) instead.
      • isExpired

        public boolean isExpired()
      • getNbf

        public Long getNbf()
      • getNotBefore

        public int getNotBefore()
        int will overflow with values after 2038. Use getNbf() instead.
      • isNotBefore

        public boolean isNotBefore​(int allowedTimeSkew)
      • isActive

        public boolean isActive()
        Tests that the token is not expired and is not-before.
      • isActive

        public boolean isActive​(int allowedTimeSkew)
      • isIssuedBeforeSessionStart

        public boolean isIssuedBeforeSessionStart​(long sessionStarted)
        sessionStarted - Time in seconds
        true if the particular token was issued before the given session start time. Which means that token cannot be issued by the particular session
      • getIat

        public Long getIat()
      • getIssuedAt

        public int getIssuedAt()
        int will overflow with values after 2038. Use getIat() instead.
      • issuedNow

        public JsonWebToken issuedNow()
        Set issuedAt to the current time
      • getIssuer

        public String getIssuer()
      • getAudience

        public String[] getAudience()
      • hasAudience

        public boolean hasAudience​(String audience)
      • hasAnyAudience

        public boolean hasAnyAudience​(List<String> audiences)
      • getSubject

        public String getSubject()
      • setSubject

        public void setSubject​(String subject)
      • getType

        public String getType()
      • getIssuedFor

        public String getIssuedFor()
        OAuth client the token was issued for.
      • getOtherClaims

        public Map<String,​Object> getOtherClaims()
        This is a map of any other claims and data that might be in the IDToken. Could be custom claims set up by the auth server
      • setOtherClaims

        public void setOtherClaims​(String name,
                                   Object value)