Package org.keycloak.representations
Class JsonWebToken
java.lang.Object
org.keycloak.representations.JsonWebToken
- All Implemented Interfaces:
Serializable
,Token
- Direct Known Subclasses:
AuthorizationResponseToken
,CIBAAuthenticationRequest
,DefaultActionTokenKey
,DockerResponseToken
,IDToken
,InitialAccessToken
,LogoutToken
,PermissionTicketToken
,RegistrationAccessToken
,TokenIntrospectionResponse
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAudience
(String audience) expiration
(int expiration) Deprecated.int will overflow with values after 2038.String[]
getExp()
int
Deprecated.int will overflow with values after 2038.getIat()
getId()
int
Deprecated.int will overflow with values after 2038.OAuth client the token was issued for.getNbf()
int
Deprecated.int will overflow with values after 2038.This is a map of any other claims and data that might be in the IDToken.getType()
boolean
hasAnyAudience
(List<String> audiences) boolean
hasAudience
(String audience) boolean
isActive()
Tests that the token is not expired and is not-before.boolean
isActive
(int allowedTimeSkew) boolean
boolean
isIssuedBeforeSessionStart
(long sessionStarted) boolean
isNotBefore
(int allowedTimeSkew) issuedAt
(int issuedAt) Deprecated.int will overflow with values after 2038.Set issuedAt to the current timenotBefore
(int notBefore) Deprecated.int will overflow with values after 2038.void
setOtherClaims
(String name, Object value) void
setSubject
(String subject)
-
Field Details
-
id
-
exp
-
nbf
-
iat
-
issuer
-
audience
-
subject
-
type
-
issuedFor
-
otherClaims
-
-
Constructor Details
-
JsonWebToken
public JsonWebToken()
-
-
Method Details
-
getId
-
id
-
getExp
-
getExpiration
Deprecated.int will overflow with values after 2038. UsegetExp()
instead. -
exp
-
expiration
Deprecated.int will overflow with values after 2038. Useexp(Long)
instead. -
isExpired
public boolean isExpired() -
getNbf
-
getNotBefore
Deprecated.int will overflow with values after 2038. UsegetNbf()
instead. -
nbf
-
notBefore
Deprecated.int will overflow with values after 2038. Usenbf(Long)
instead. -
isNotBefore
public boolean isNotBefore(int allowedTimeSkew) -
isActive
public boolean isActive()Tests that the token is not expired and is not-before.- Returns:
-
isActive
public boolean isActive(int allowedTimeSkew) -
isIssuedBeforeSessionStart
public boolean isIssuedBeforeSessionStart(long sessionStarted) - Parameters:
sessionStarted
- Time in seconds- Returns:
- 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
-
getIssuedAt
Deprecated.int will overflow with values after 2038. UsegetIat()
instead. -
issuedNow
Set issuedAt to the current time -
iat
-
issuedAt
Deprecated.int will overflow with values after 2038. Useiat(Long)
()} instead. -
getIssuer
-
issuer
-
getAudience
-
hasAudience
-
hasAnyAudience
-
audience
-
addAudience
-
getSubject
-
subject
-
setSubject
-
getType
-
type
-
getIssuedFor
OAuth client the token was issued for.- Returns:
-
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:
-
setOtherClaims
-
getCategory
- Specified by:
getCategory
in interfaceToken
-