public interface JsonWebToken extends Principal
Principal
api.Modifier and Type | Method and Description |
---|---|
default <T> Optional<T> |
claim(Claims claim)
A utility method to access a claim value in an Optional wrapper
|
default <T> Optional<T> |
claim(String claimName)
A utility method to access a claim value in an Optional wrapper
|
default boolean |
containsClaim(String claimName)
Verify is a given claim exists
|
default Set<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(String claimName)
Access the value of the indicated claim.
|
Set<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 Set<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 String |
getIssuer()
The iss(Issuer) claim identifies the principal that issued the JWT
|
String |
getName()
Returns the unique name of this principal.
|
default String |
getRawToken()
Get the raw bearer token string originally passed in the authentication header
|
default String |
getSubject()
The sub(Subject) claim identifies the principal that is the subject of the JWT.
|
default String |
getTokenID()
The jti(JWT ID) claim provides a unique identifier for the JWT.
|
String getName()
default String getRawToken()
default String getIssuer()
default Set<String> getAudience()
default String getSubject()
default String getTokenID()
default long getExpirationTime()
default long getIssuedAtTime()
default Set<String> getGroups()
Set<String> getClaimNames()
default boolean containsClaim(String claimName)
claimName
- - the name of the claim<T> T getClaim(String claimName)
T
- The claim typeclaimName
- - the name of the claimdefault <T> T getClaim(Claims claim)
T
- The claim typeclaim
- - the claimdefault <T> Optional<T> claim(String claimName)
T
- - the type of the claim value to returnclaimName
- - the name of the claimCopyright © 2017 – 2022 Eclipse Foundation. All rights reserved.
Use is subject to license terms.