Class Jwt
java.lang.Object
org.springframework.security.oauth2.core.AbstractOAuth2Token
org.springframework.security.oauth2.jwt.Jwt
- All Implemented Interfaces:
- Serializable,- org.springframework.security.oauth2.core.ClaimAccessor,- org.springframework.security.oauth2.core.OAuth2Token,- JwtClaimAccessor
public class Jwt
extends org.springframework.security.oauth2.core.AbstractOAuth2Token
implements JwtClaimAccessor
An implementation of an 
AbstractOAuth2Token representing a JSON Web Token
 (JWT).
 
 JWTs represent a set of "claims" as a JSON object that may be encoded in a
 JSON Web Signature (JWS) and/or JSON Web Encryption (JWE) structure. The JSON object,
 also known as the JWT Claims Set, consists of one or more claim name/value pairs. The
 claim name is a String and the claim value is an arbitrary JSON object.
- Since:
- 5.0
- See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the JWT Claims Set.Returns the JOSE header(s).static Jwt.BuilderwithTokenValue(String tokenValue) Return aJwt.BuilderMethods inherited from class org.springframework.security.oauth2.core.AbstractOAuth2Tokenequals, getExpiresAt, getIssuedAt, getTokenValue, hashCodeMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.oauth2.core.ClaimAccessorgetClaim, getClaimAsBoolean, getClaimAsInstant, getClaimAsMap, getClaimAsString, getClaimAsStringList, getClaimAsURL, hasClaimMethods inherited from interface org.springframework.security.oauth2.jwt.JwtClaimAccessorgetAudience, getExpiresAt, getId, getIssuedAt, getIssuer, getNotBefore, getSubject
- 
Constructor Details- 
Jwtpublic Jwt(String tokenValue, Instant issuedAt, Instant expiresAt, Map<String, Object> headers, Map<String, Object> claims) Constructs aJwtusing the provided parameters.- Parameters:
- tokenValue- the token value
- issuedAt- the time at which the JWT was issued
- expiresAt- the expiration time on or after which the JWT MUST NOT be accepted
- headers- the JOSE header(s)
- claims- the JWT Claims Set
 
 
- 
- 
Method Details- 
getHeadersReturns the JOSE header(s).- Returns:
- a Mapof the JOSE header(s)
 
- 
getClaimsReturns the JWT Claims Set.- Specified by:
- getClaimsin interface- org.springframework.security.oauth2.core.ClaimAccessor
- Returns:
- a Mapof the JWT Claims Set
 
- 
withTokenValueReturn aJwt.Builder- Returns:
- A Jwt.Builder
 
 
-