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 resultingJwt
build()
Build theJwt
Use this claim in the resultingJwt
Provides access to everyclaim(String, Object)
declared so far with the possibility to add, replace, or remove.Use this expiration in the resultingJwt
Use this header in the resultingJwt
Provides access to everyheader(String, Object)
declared so far with the possibility to add, replace, or remove.Use this issued-at timestamp in the resultingJwt
Use this issuer in the resultingJwt
Use this identifier in the resultingJwt
Use this not-before timestamp in the resultingJwt
Use this subject in the resultingJwt
tokenValue
(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.Builder
for further configurations
-
claim
Use this claim in the resultingJwt
- Parameters:
name
- The claim namevalue
- The claim value- Returns:
- the
Jwt.Builder
for 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.Builder
for further configurations
-
header
Use this header in the resultingJwt
- Parameters:
name
- The header namevalue
- The header value- Returns:
- the
Jwt.Builder
for 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.Builder
for further configurations
-
audience
Use this audience in the resultingJwt
- Parameters:
audience
- The audience(s) to use- Returns:
- the
Jwt.Builder
for further configurations
-
expiresAt
Use this expiration in the resultingJwt
- Parameters:
expiresAt
- The expiration to use- Returns:
- the
Jwt.Builder
for further configurations
-
jti
Use this identifier in the resultingJwt
- Parameters:
jti
- The identifier to use- Returns:
- the
Jwt.Builder
for further configurations
-
issuedAt
Use this issued-at timestamp in the resultingJwt
- Parameters:
issuedAt
- The issued-at timestamp to use- Returns:
- the
Jwt.Builder
for further configurations
-
issuer
Use this issuer in the resultingJwt
- Parameters:
issuer
- The issuer to use- Returns:
- the
Jwt.Builder
for further configurations
-
notBefore
Use this not-before timestamp in the resultingJwt
- Parameters:
notBefore
- The not-before timestamp to use- Returns:
- the
Jwt.Builder
for further configurations
-
subject
Use this subject in the resultingJwt
- Parameters:
subject
- The subject to use- Returns:
- the
Jwt.Builder
for further configurations
-
build
Build theJwt
- Returns:
- The constructed
Jwt
-