AUDIENCE, EXPIRATION, ID, ISSUED_AT, ISSUER, NOT_BEFORE, SUBJECT| Constructor and Description |
|---|
DefaultClaims() |
DefaultClaims(Map<String,Object> map) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(String claimName,
Class<T> requiredType) |
String |
getAudience()
Returns the JWT
aud (audience) value or null if not present. |
Date |
getExpiration()
Returns the JWT
exp (expiration) timestamp or null if not present. |
String |
getId()
Returns the JWTs
jti (JWT ID) value or null if not present. |
Date |
getIssuedAt()
Returns the JWT
iat (issued at) timestamp or null if not present. |
String |
getIssuer()
Returns the JWT
iss (issuer) value or null if not present. |
Date |
getNotBefore()
Returns the JWT
nbf (not before) timestamp or null if not present. |
String |
getSubject()
Returns the JWT
sub (subject) value or null if not present. |
Claims |
setAudience(String aud)
Sets the JWT
aud (audience) value. |
Claims |
setExpiration(Date exp)
Sets the JWT
exp (expiration) timestamp. |
Claims |
setId(String jti)
Sets the JWT
jti (JWT ID) value. |
Claims |
setIssuedAt(Date iat)
Sets the JWT
iat (issued at) timestamp. |
Claims |
setIssuer(String iss)
Sets the JWT
iss (issuer) value. |
Claims |
setNotBefore(Date nbf)
Sets the JWT
nbf (not before) timestamp. |
Claims |
setSubject(String sub)
Sets the JWT
sub (subject) value. |
clear, containsKey, containsValue, entrySet, equals, get, getDate, getString, hashCode, isEmpty, keySet, put, putAll, remove, setDate, setValue, size, toDate, toString, valuesclone, finalize, getClass, notify, notifyAll, wait, wait, waitclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic String getIssuer()
Claimsiss (issuer) value or null if not present.public Claims setIssuer(String iss)
Claimsiss (issuer) value. A null value will remove the property from the JSON map.setIssuer in interface ClaimssetIssuer in interface ClaimsMutator<Claims>iss - the JWT iss value or null to remove the property from the JSON map.Claims instance for method chaining.public String getSubject()
Claimssub (subject) value or null if not present.getSubject in interface Claimssub value or null if not present.public Claims setSubject(String sub)
Claimssub (subject) value. A null value will remove the property from the JSON map.setSubject in interface ClaimssetSubject in interface ClaimsMutator<Claims>sub - the JWT sub value or null to remove the property from the JSON map.Claims instance for method chaining.public String getAudience()
Claimsaud (audience) value or null if not present.getAudience in interface Claimsaud value or null if not present.public Claims setAudience(String aud)
Claimsaud (audience) value. A null value will remove the property from the JSON map.setAudience in interface ClaimssetAudience in interface ClaimsMutator<Claims>aud - the JWT aud value or null to remove the property from the JSON map.Claims instance for method chaining.public Date getExpiration()
Claimsexp (expiration) timestamp or null if not present.
A JWT obtained after this timestamp should not be used.
getExpiration in interface Claimsexp value or null if not present.public Claims setExpiration(Date exp)
Claimsexp (expiration) timestamp. A null value will remove the property from the JSON map.
A JWT obtained after this timestamp should not be used.
setExpiration in interface ClaimssetExpiration in interface ClaimsMutator<Claims>exp - the JWT exp value or null to remove the property from the JSON map.Claims instance for method chaining.public Date getNotBefore()
Claimsnbf (not before) timestamp or null if not present.
A JWT obtained before this timestamp should not be used.
getNotBefore in interface Claimsnbf value or null if not present.public Claims setNotBefore(Date nbf)
Claimsnbf (not before) timestamp. A null value will remove the property from the JSON map.
A JWT obtained before this timestamp should not be used.
setNotBefore in interface ClaimssetNotBefore in interface ClaimsMutator<Claims>nbf - the JWT nbf value or null to remove the property from the JSON map.Claims instance for method chaining.public Date getIssuedAt()
Claimsiat (issued at) timestamp or null if not present.
If present, this value is the timestamp when the JWT was created.
getIssuedAt in interface Claimsnbf value or null if not present.public Claims setIssuedAt(Date iat)
Claimsiat (issued at) timestamp. A null value will remove the property from the JSON map.
The value is the timestamp when the JWT was created.
setIssuedAt in interface ClaimssetIssuedAt in interface ClaimsMutator<Claims>iat - the JWT iat value or null to remove the property from the JSON map.Claims instance for method chaining.public String getId()
Claimsjti (JWT ID) value or null if not present.
This value is a CaSe-SenSiTiVe unique identifier for the JWT. If available, this value is expected to be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object. The ID can be used to prevent the JWT from being replayed.
public Claims setId(String jti)
Claimsjti (JWT ID) value. A null value will remove the property from the JSON map.
This value is a CaSe-SenSiTiVe unique identifier for the JWT. If specified, this value MUST be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object. The ID can be used to prevent the JWT from being replayed.
setId in interface ClaimssetId in interface ClaimsMutator<Claims>jti - the JWT jti value or null to remove the property from the JSON map.Claims instance for method chaining.Copyright © 2017. All rights reserved.