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.Builderaudience(java.util.Collection<java.lang.String> audience)Use this audience in the resultingJwtJwtbuild()Build theJwtJwt.Builderclaim(java.lang.String name, java.lang.Object value)Use this claim in the resultingJwtJwt.Builderclaims(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.BuilderexpiresAt(java.time.Instant expiresAt)Use this expiration in the resultingJwtJwt.Builderheader(java.lang.String name, java.lang.Object value)Use this header in the resultingJwtJwt.Builderheaders(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.BuilderissuedAt(java.time.Instant issuedAt)Use this issued-at timestamp in the resultingJwtJwt.Builderissuer(java.lang.String issuer)Use this issuer in the resultingJwtJwt.Builderjti(java.lang.String jti)Use this identifier in the resultingJwtJwt.BuildernotBefore(java.time.Instant notBefore)Use this not-before timestamp in the resultingJwtJwt.Buildersubject(java.lang.String subject)Use this subject in the resultingJwtJwt.BuildertokenValue(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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor 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.Builderfor further configurations
-
-