Package org.gcube.common.keycloak.model
Class JsonWebToken
java.lang.Object
org.gcube.common.keycloak.model.JsonWebToken
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
IDToken,TokenIntrospectionResponse
- Author:
- Bill Burke
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAudience(String audience) String[]getExp()getIat()getId()OAuth client the token was issued for.getNbf()This is a map of any other claims and data that might be in the IDToken.getType()booleanhasAudience(String audience) booleanisActive()Tests that the token is not expired and is not-before.booleanisActive(int allowedTimeSkew) booleanbooleanisNotBefore(int allowedTimeSkew) Set issuedAt to the current timevoidsetOtherClaims(String name, Object value) voidsetSubject(String subject)
-
Field Details
-
id
-
exp
-
nbf
-
iat
-
issuer
-
audience
-
subject
-
type
-
issuedFor
-
otherClaims
-
-
Constructor Details
-
JsonWebToken
public JsonWebToken()
-
-
Method Details
-
getId
-
id
-
getExp
-
exp
-
isExpired
public boolean isExpired() -
getNbf
-
nbf
-
isNotBefore
public boolean isNotBefore(int allowedTimeSkew) -
isActive
public boolean isActive()Tests that the token is not expired and is not-before.- Returns:
trueif is not expired and is not-before
-
isActive
public boolean isActive(int allowedTimeSkew) -
getIat
-
issuedNow
Set issuedAt to the current time- Returns:
- the token itself
-
iat
-
getIssuer
-
issuer
-
getAudience
-
hasAudience
-
audience
-
addAudience
-
getSubject
-
subject
-
setSubject
-
getType
-
type
-
getIssuedFor
OAuth client the token was issued for.- Returns:
- the issued for vale
-
issuedFor
-
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- Returns:
- the object's other claims
-
setOtherClaims
-