Class Jwt.Builder
- java.lang.Object
-
- org.springframework.security.oauth2.jwt.Jwt.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Jwt.Builder
audience(java.util.Collection<java.lang.String> audience)
Use this audience in the resultingJwt
Jwt
build()
Build theJwt
Jwt.Builder
claim(java.lang.String name, java.lang.Object value)
Use this claim in the resultingJwt
Jwt.Builder
claims(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> claimsConsumer)
Provides access to everyclaim(String, Object)
declared so far with the possibility to add, replace, or remove.Jwt.Builder
expiresAt(java.time.Instant expiresAt)
Use this expiration in the resultingJwt
Jwt.Builder
header(java.lang.String name, java.lang.Object value)
Use this header in the resultingJwt
Jwt.Builder
headers(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> headersConsumer)
Provides access to everyheader(String, Object)
declared so far with the possibility to add, replace, or remove.Jwt.Builder
issuedAt(java.time.Instant issuedAt)
Use this issued-at timestamp in the resultingJwt
Jwt.Builder
issuer(java.lang.String issuer)
Use this issuer in the resultingJwt
Jwt.Builder
jti(java.lang.String jti)
Use this identifier in the resultingJwt
Jwt.Builder
notBefore(java.time.Instant notBefore)
Use this not-before timestamp in the resultingJwt
Jwt.Builder
subject(java.lang.String subject)
Use this subject in the resultingJwt
Jwt.Builder
tokenValue(java.lang.String tokenValue)
Use this token value in the resultingJwt
-
-
-
Method Detail
-
tokenValue
public Jwt.Builder tokenValue(java.lang.String tokenValue)
Use this token value in the resultingJwt
- Parameters:
tokenValue
- The token value to use- Returns:
- the
Jwt.Builder
for further configurations
-
claim
public Jwt.Builder claim(java.lang.String name, java.lang.Object value)
Use this claim in the resultingJwt
- Parameters:
name
- The claim namevalue
- The claim value- Returns:
- the
Jwt.Builder
for further configurations
-
claims
public Jwt.Builder claims(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> claimsConsumer)
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
public Jwt.Builder header(java.lang.String name, java.lang.Object value)
Use this header in the resultingJwt
- Parameters:
name
- The header namevalue
- The header value- Returns:
- the
Jwt.Builder
for further configurations
-
headers
public Jwt.Builder headers(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> headersConsumer)
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
public Jwt.Builder audience(java.util.Collection<java.lang.String> audience)
Use this audience in the resultingJwt
- Parameters:
audience
- The audience(s) to use- Returns:
- the
Jwt.Builder
for further configurations
-
expiresAt
public Jwt.Builder expiresAt(java.time.Instant expiresAt)
Use this expiration in the resultingJwt
- Parameters:
expiresAt
- The expiration to use- Returns:
- the
Jwt.Builder
for further configurations
-
jti
public Jwt.Builder jti(java.lang.String jti)
Use this identifier in the resultingJwt
- Parameters:
jti
- The identifier to use- Returns:
- the
Jwt.Builder
for further configurations
-
issuedAt
public Jwt.Builder issuedAt(java.time.Instant 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
public Jwt.Builder issuer(java.lang.String issuer)
Use this issuer in the resultingJwt
- Parameters:
issuer
- The issuer to use- Returns:
- the
Jwt.Builder
for further configurations
-
notBefore
public Jwt.Builder notBefore(java.time.Instant 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
public Jwt.Builder subject(java.lang.String subject)
Use this subject in the resultingJwt
- Parameters:
subject
- The subject to use- Returns:
- the
Jwt.Builder
for further configurations
-
-