public interface JsonWebToken
extends java.security.Principal
Principal
api.Modifier and Type | Method and Description |
---|---|
default <T> java.util.Optional<T> |
claim(Claims claim)
A utility method to access a claim value in an Optional
wrapper
|
default <T> java.util.Optional<T> |
claim(java.lang.String claimName)
A utility method to access a claim value in an Optional
wrapper
|
default boolean |
containsClaim(java.lang.String claimName)
Verify is a given claim exists
|
default java.util.Set<java.lang.String> |
getAudience()
The aud(Audience) claim identifies the recipients that the JWT is
intended for.
|
default <T> T |
getClaim(Claims claim)
Access the value of the indicated claim.
|
<T> T |
getClaim(java.lang.String claimName)
Access the value of the indicated claim.
|
java.util.Set<java.lang.String> |
getClaimNames()
Access the names of all claims are associated with this token.
|
default long |
getExpirationTime()
The exp (Expiration time) claim identifies the expiration time on or
after which the JWT MUST NOT be accepted
for processing in seconds since 1970-01-01T00:00:00Z UTC
|
default java.util.Set<java.lang.String> |
getGroups()
The groups claim provides the group names the JWT principal has been
granted.
|
default long |
getIssuedAtTime()
The iat(Issued at time) claim identifies the time at which the JWT was
issued in seconds since 1970-01-01T00:00:00Z UTC
|
default java.lang.String |
getIssuer()
The iss(Issuer) claim identifies the principal that issued the JWT
|
java.lang.String |
getName()
Returns the unique name of this principal.
|
default java.lang.String |
getRawToken()
Get the raw bearer token string originally passed in the authentication
header
|
default java.lang.String |
getSubject()
The sub(Subject) claim identifies the principal that is the subject of
the JWT.
|
default java.lang.String |
getTokenID()
The jti(JWT ID) claim provides a unique identifier for the JWT.
|
java.lang.String getName()
getName
in interface java.security.Principal
default java.lang.String getRawToken()
default java.lang.String getIssuer()
default java.util.Set<java.lang.String> getAudience()
default java.lang.String getSubject()
default java.lang.String getTokenID()
default long getExpirationTime()
default long getIssuedAtTime()
default java.util.Set<java.lang.String> getGroups()
java.util.Set<java.lang.String> getClaimNames()
default boolean containsClaim(java.lang.String claimName)
claimName
- - the name of the claim<T> T getClaim(java.lang.String claimName)
T
- The claim typeclaimName
- - the name of the claimdefault <T> T getClaim(Claims claim)
T
- The claim typeclaim
- - the claimdefault <T> java.util.Optional<T> claim(java.lang.String claimName)
T
- - the type of the claim value to returnclaimName
- - the name of the claimdefault <T> java.util.Optional<T> claim(Claims claim)
T
- - the type of the claim value to returnclaim
- - the claim