Class Jwt.Builder
java.lang.Object
org.springframework.security.oauth2.jwt.Jwt.Builder
- Enclosing class:
- Jwt
Helps configure a
Jwt- Since:
- 5.2
-
Method Summary
Modifier and TypeMethodDescriptionaudience(Collection<String> audience) Use this audience in the resultingJwtbuild()Build theJwtUse this claim in the resultingJwtProvides access to everyclaim(String, Object)declared so far with the possibility to add, replace, or remove.Use this expiration in the resultingJwtUse this header in the resultingJwtProvides access to everyheader(String, Object)declared so far with the possibility to add, replace, or remove.Use this issued-at timestamp in the resultingJwtUse this issuer in the resultingJwtUse this identifier in the resultingJwtUse this not-before timestamp in the resultingJwtUse this subject in the resultingJwttokenValue(String tokenValue) Use this token value in the resultingJwt
-
Method Details
-
tokenValue
Use this token value in the resultingJwt- Parameters:
tokenValue- The token value to use- Returns:
- the
Jwt.Builderfor further configurations
-
claim
Use this claim in the resultingJwt- Parameters:
name- The claim namevalue- The claim value- Returns:
- the
Jwt.Builderfor further configurations
-
claims
Provides access to everyclaim(String, Object)declared so far with the possibility to add, replace, or remove.- Parameters:
claimsConsumer- the consumer- Returns:
- the
Jwt.Builderfor further configurations
-
header
Use this header in the resultingJwt- Parameters:
name- The header namevalue- The header value- Returns:
- the
Jwt.Builderfor further configurations
-
headers
Provides access to everyheader(String, Object)declared so far with the possibility to add, replace, or remove.- Parameters:
headersConsumer- the consumer- Returns:
- the
Jwt.Builderfor further configurations
-
audience
Use this audience in the resultingJwt- Parameters:
audience- The audience(s) to use- Returns:
- the
Jwt.Builderfor further configurations
-
expiresAt
Use this expiration in the resultingJwt- Parameters:
expiresAt- The expiration to use- Returns:
- the
Jwt.Builderfor further configurations
-
jti
Use this identifier in the resultingJwt- Parameters:
jti- The identifier to use- Returns:
- the
Jwt.Builderfor further configurations
-
issuedAt
Use this issued-at timestamp in the resultingJwt- Parameters:
issuedAt- The issued-at timestamp to use- Returns:
- the
Jwt.Builderfor further configurations
-
issuer
Use this issuer in the resultingJwt- Parameters:
issuer- The issuer to use- Returns:
- the
Jwt.Builderfor further configurations
-
notBefore
Use this not-before timestamp in the resultingJwt- Parameters:
notBefore- The not-before timestamp to use- Returns:
- the
Jwt.Builderfor further configurations
-
subject
Use this subject in the resultingJwt- Parameters:
subject- The subject to use- Returns:
- the
Jwt.Builderfor further configurations
-
build
Build theJwt- Returns:
- The constructed
Jwt
-