public static class JwtClaimsSet.Builder extends Object
JwtClaimsSet
.Modifier and Type | Method and Description |
---|---|
JwtClaimsSet.Builder | audience(List<String> audience) Sets the audience (aud) claim, which identifies the recipient(s) that the JWT is intended for. |
JwtClaimsSet | build() Builds a new JwtClaimsSet . |
JwtClaimsSet.Builder | claim(String name, Object value) Sets the claim. |
JwtClaimsSet.Builder | claims(Consumer<Map<String,Object>> claimsConsumer) A Consumer to be provided access to the claims set allowing the ability to add, replace, or remove. |
JwtClaimsSet.Builder | expiresAt(Instant expiresAt) Sets the expiration time (exp) claim, which identifies the time on or after which the JWT MUST NOT be accepted for processing. |
JwtClaimsSet.Builder | id(String jti) Sets the JWT ID (jti) claim, which provides a unique identifier for the JWT. |
JwtClaimsSet.Builder | issuedAt(Instant issuedAt) Sets the issued at (iat) claim, which identifies the time at which the JWT was issued. |
JwtClaimsSet.Builder | issuer(URL issuer) Sets the issuer (iss) claim, which identifies the principal that issued the JWT. |
JwtClaimsSet.Builder | notBefore(Instant notBefore) Sets the not before (nbf) claim, which identifies the time before which the JWT MUST NOT be accepted for processing. |
JwtClaimsSet.Builder | subject(String subject) Sets the subject (sub) claim, which identifies the principal that is the subject of the JWT. |
public JwtClaimsSet.Builder issuer(URL issuer)
(iss)
claim, which identifies the principal that issued the JWT.issuer
- the issuer identifierJwtClaimsSet.Builder
public JwtClaimsSet.Builder subject(String subject)
(sub)
claim, which identifies the principal that is the subject of the JWT.subject
- the subject identifierJwtClaimsSet.Builder
public JwtClaimsSet.Builder audience(List<String> audience)
(aud)
claim, which identifies the recipient(s) that the JWT is intended for.audience
- the audience that this JWT is intended forJwtClaimsSet.Builder
public JwtClaimsSet.Builder expiresAt(Instant expiresAt)
(exp)
claim, which identifies the time on or after which the JWT MUST NOT be accepted for processing.expiresAt
- the time on or after which the JWT MUST NOT be accepted for processingJwtClaimsSet.Builder
public JwtClaimsSet.Builder notBefore(Instant notBefore)
(nbf)
claim, which identifies the time before which the JWT MUST NOT be accepted for processing.notBefore
- the time before which the JWT MUST NOT be accepted for processingJwtClaimsSet.Builder
public JwtClaimsSet.Builder issuedAt(Instant issuedAt)
(iat)
claim, which identifies the time at which the JWT was issued.issuedAt
- the time at which the JWT was issuedJwtClaimsSet.Builder
public JwtClaimsSet.Builder id(String jti)
(jti)
claim, which provides a unique identifier for the JWT.jti
- the unique identifier for the JWTJwtClaimsSet.Builder
public JwtClaimsSet.Builder claim(String name, Object value)
name
- the claim namevalue
- the claim valueJwtClaimsSet.Builder
public JwtClaimsSet.Builder claims(Consumer<Map<String,Object>> claimsConsumer)
Consumer
to be provided access to the claims set allowing the ability to add, replace, or remove.claimsConsumer
- a Consumer
of the claims setpublic JwtClaimsSet build()
JwtClaimsSet
.JwtClaimsSet