Package com.auth0.jwt.interfaces
Interface Payload
-
- All Known Subinterfaces:
DecodedJWT
public interface PayloadThe Payload class represents the 2nd part of the JWT, where the Payload value is held.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<java.lang.String>getAudience()Get the value of the "aud" claim, or null if it's not available.ClaimgetClaim(java.lang.String name)Get a Claim given its name.java.util.Map<java.lang.String,Claim>getClaims()Get the Claims defined in the Token.java.util.DategetExpiresAt()Get the value of the "exp" claim, or null if it's not available.default java.time.InstantgetExpiresAtAsInstant()Get the value of the "exp" claim as an Instant, or null if it's not available.java.lang.StringgetId()Get the value of the "jti" claim, or null if it's not available.java.util.DategetIssuedAt()Get the value of the "iat" claim, or null if it's not available.default java.time.InstantgetIssuedAtAsInstant()Get the value of the "iat" claim as an Instant, or null if it's not available.java.lang.StringgetIssuer()Get the value of the "iss" claim, or null if it's not available.java.util.DategetNotBefore()Get the value of the "nbf" claim, or null if it's not available.default java.time.InstantgetNotBeforeAsInstant()Get the value of the "nbf" claim as an Instant, or null if it's not available.java.lang.StringgetSubject()Get the value of the "sub" claim, or null if it's not available.
-
-
-
Method Detail
-
getIssuer
java.lang.String getIssuer()
Get the value of the "iss" claim, or null if it's not available.- Returns:
- the Issuer value or null.
-
getSubject
java.lang.String getSubject()
Get the value of the "sub" claim, or null if it's not available.- Returns:
- the Subject value or null.
-
getAudience
java.util.List<java.lang.String> getAudience()
Get the value of the "aud" claim, or null if it's not available.- Returns:
- the Audience value or null.
-
getExpiresAt
java.util.Date getExpiresAt()
Get the value of the "exp" claim, or null if it's not available.- Returns:
- the Expiration Time value or null.
-
getExpiresAtAsInstant
default java.time.Instant getExpiresAtAsInstant()
Get the value of the "exp" claim as an Instant, or null if it's not available.- Returns:
- the Expiration Time value or null.
-
getNotBefore
java.util.Date getNotBefore()
Get the value of the "nbf" claim, or null if it's not available.- Returns:
- the Not Before value or null.
-
getNotBeforeAsInstant
default java.time.Instant getNotBeforeAsInstant()
Get the value of the "nbf" claim as an Instant, or null if it's not available.- Returns:
- the Not Before value or null.
-
getIssuedAt
java.util.Date getIssuedAt()
Get the value of the "iat" claim, or null if it's not available.- Returns:
- the Issued At value or null.
-
getIssuedAtAsInstant
default java.time.Instant getIssuedAtAsInstant()
Get the value of the "iat" claim as an Instant, or null if it's not available.- Returns:
- the Issued At value or null.
-
getId
java.lang.String getId()
Get the value of the "jti" claim, or null if it's not available.- Returns:
- the JWT ID value or null.
-
getClaim
Claim getClaim(java.lang.String name)
Get a Claim given its name. If the Claim wasn't specified in the Payload, a 'null claim' will be returned. All the methods of that claim will returnnull.- Parameters:
name- the name of the Claim to retrieve.- Returns:
- a non-null Claim.
-
getClaims
java.util.Map<java.lang.String,Claim> getClaims()
Get the Claims defined in the Token.- Returns:
- a non-null Map containing the Claims defined in the Token.
-
-