public interface Claims
Modifier and Type | Interface and Description |
---|---|
static interface |
Claims.Builder |
Modifier and Type | Field and Description |
---|---|
static String |
AUD |
static String |
EXP |
static String |
IAT |
static String |
ISS |
static String |
JTI |
static String |
SUB |
Modifier and Type | Method and Description |
---|---|
Optional<List> |
audiences()
Gets an optional list of values for the "aud".
|
<T> Optional<T> |
claim(String name,
Class<? extends T> type)
Gets an optional value for arbitrary claim.
|
Optional<Instant> |
expiresAt()
Gets an optional value for "exp" claim.
|
<T> T |
get(String name,
Class<? extends T> type) |
List |
getAudience()
Gets the value of the "aud" claim.
|
Instant |
getExpiresAt()
Gets the value of the "exp" claim.
|
String |
getId()
Gets the value of the "jti" claim.
|
Instant |
getIssuedAt()
Gets the value of the "iat" claim.
|
String |
getIssuer()
Gets the value of the "iss" claim.
|
String |
getSubject()
Gets the value of the "sub" claim.
|
Optional<String> |
id()
Gets an optional value for the "jti" claim.
|
Optional<Instant> |
issuedAt()
Gets an optional value for "iat" claim.
|
Optional<String> |
issuer()
Gets an optional value for the "iss" claim.
|
Optional<String> |
subject()
Gets an optional value for "sub" claim.
|
String |
toJson()
Produces a JSON object representation of this Claims object encoded as a
string.
|
static final String JTI
static final String IAT
static final String EXP
static final String ISS
static final String AUD
static final String SUB
String getId()
NullPointerException
- if there is no "jti" claimString getIssuer()
NullPointerException
- if there is no "iss" claimList getAudience()
NullPointerException
- if there is no "aud" claimString getSubject()
NullPointerException
- if there is no "sub" claimInstant getIssuedAt()
NullPointerException
- if there is no "iat" claimInstant getExpiresAt()
NullPointerException
- if there is no "exp" claimOptional<String> issuer()
Optional<List> audiences()
Optional<String> subject()
Optional<Instant> issuedAt()
Optional<Instant> expiresAt()
<T> Optional<T> claim(String name, Class<? extends T> type)
T
- return data typename
- name of the claimtype
- type to which the value will be coercedClassCastException
- if the value cannot be coerced to the given
typeString toJson()
Copyright © 2019. All rights reserved.