public class JsonWebToken extends Object implements Serializable, Token
Modifier and Type | Field and Description |
---|---|
protected String[] |
audience |
protected Long |
exp |
protected Long |
iat |
protected String |
id |
String |
issuedFor |
protected String |
issuer |
protected Long |
nbf |
protected Map<String,Object> |
otherClaims |
protected String |
subject |
protected String |
type |
Constructor and Description |
---|
JsonWebToken() |
Modifier and Type | Method and Description |
---|---|
JsonWebToken |
addAudience(String audience) |
JsonWebToken |
audience(String... audience) |
JsonWebToken |
exp(Long exp) |
JsonWebToken |
expiration(int expiration)
Deprecated.
int will overflow with values after 2038. Use
exp(Long) instead. |
String[] |
getAudience() |
TokenCategory |
getCategory() |
Long |
getExp() |
int |
getExpiration()
Deprecated.
int will overflow with values after 2038. Use
getExp() instead. |
Long |
getIat() |
String |
getId() |
int |
getIssuedAt()
Deprecated.
int will overflow with values after 2038. Use
getIat() instead. |
String |
getIssuedFor()
OAuth client the token was issued for.
|
String |
getIssuer() |
Long |
getNbf() |
int |
getNotBefore()
Deprecated.
int will overflow with values after 2038. Use
getNbf() instead. |
Map<String,Object> |
getOtherClaims()
This is a map of any other claims and data that might be in the IDToken.
|
String |
getSubject() |
String |
getType() |
boolean |
hasAudience(String audience) |
JsonWebToken |
iat(Long iat) |
JsonWebToken |
id(String id) |
boolean |
isActive()
Tests that the token is not expired and is not-before.
|
boolean |
isActive(int allowedTimeSkew) |
boolean |
isExpired() |
boolean |
isIssuedBeforeSessionStart(long sessionStarted) |
boolean |
isNotBefore(int allowedTimeSkew) |
JsonWebToken |
issuedAt(int issuedAt)
Deprecated.
int will overflow with values after 2038. Use
iat(Long) ()} instead. |
JsonWebToken |
issuedFor(String issuedFor) |
JsonWebToken |
issuedNow()
Set issuedAt to the current time
|
JsonWebToken |
issuer(String issuer) |
JsonWebToken |
nbf(Long nbf) |
JsonWebToken |
notBefore(int notBefore)
Deprecated.
int will overflow with values after 2038. Use
nbf(Long) instead. |
void |
setOtherClaims(String name,
Object value) |
void |
setSubject(String subject) |
JsonWebToken |
subject(String subject) |
JsonWebToken |
type(String type) |
protected String id
protected Long exp
protected Long nbf
protected Long iat
protected String issuer
protected String[] audience
protected String subject
protected String type
public String issuedFor
public String getId()
public JsonWebToken id(String id)
public Long getExp()
@Deprecated public int getExpiration()
getExp()
instead.public JsonWebToken exp(Long exp)
public JsonWebToken expiration(int expiration)
exp(Long)
instead.public boolean isExpired()
public Long getNbf()
@Deprecated public int getNotBefore()
getNbf()
instead.public JsonWebToken nbf(Long nbf)
@Deprecated public JsonWebToken notBefore(int notBefore)
nbf(Long)
instead.public boolean isNotBefore(int allowedTimeSkew)
public boolean isActive()
public boolean isActive(int allowedTimeSkew)
public boolean isIssuedBeforeSessionStart(long sessionStarted)
sessionStarted
- Time in secondspublic Long getIat()
@Deprecated public int getIssuedAt()
getIat()
instead.public JsonWebToken issuedNow()
public JsonWebToken iat(Long iat)
@Deprecated public JsonWebToken issuedAt(int issuedAt)
iat(Long)
()} instead.public String getIssuer()
public JsonWebToken issuer(String issuer)
public String[] getAudience()
public boolean hasAudience(String audience)
public JsonWebToken audience(String... audience)
public JsonWebToken addAudience(String audience)
public String getSubject()
public JsonWebToken subject(String subject)
public void setSubject(String subject)
public String getType()
public JsonWebToken type(String type)
public String getIssuedFor()
public JsonWebToken issuedFor(String issuedFor)
public Map<String,Object> getOtherClaims()
public TokenCategory getCategory()
getCategory
in interface Token
Copyright © 2021 JBoss by Red Hat. All rights reserved.