Class JwtClaimsSet.Builder
java.lang.Object
org.springframework.security.oauth2.jwt.JwtClaimsSet.Builder
- Enclosing class:
- JwtClaimsSet
A builder for
JwtClaimsSet
.-
Method Summary
Modifier and TypeMethodDescriptionSets the audience(aud)
claim, which identifies the recipient(s) that the JWT is intended for.build()
Builds a newJwtClaimsSet
.Sets the claim.AConsumer
to be provided access to the claims allowing the ability to add, replace, or remove.Sets the expiration time(exp)
claim, which identifies the time on or after which the JWT MUST NOT be accepted for processing.Sets the JWT ID(jti)
claim, which provides a unique identifier for the JWT.Sets the issued at(iat)
claim, which identifies the time at which the JWT was issued.Sets the issuer(iss)
claim, which identifies the principal that issued the JWT.Sets the not before(nbf)
claim, which identifies the time before which the JWT MUST NOT be accepted for processing.Sets the subject(sub)
claim, which identifies the principal that is the subject of the JWT.
-
Method Details
-
issuer
Sets the issuer(iss)
claim, which identifies the principal that issued the JWT.- Parameters:
issuer
- the issuer identifier- Returns:
- the
JwtClaimsSet.Builder
-
subject
Sets the subject(sub)
claim, which identifies the principal that is the subject of the JWT.- Parameters:
subject
- the subject identifier- Returns:
- the
JwtClaimsSet.Builder
-
audience
Sets the audience(aud)
claim, which identifies the recipient(s) that the JWT is intended for.- Parameters:
audience
- the audience that this JWT is intended for- Returns:
- the
JwtClaimsSet.Builder
-
expiresAt
Sets the expiration time(exp)
claim, which identifies the time on or after which the JWT MUST NOT be accepted for processing.- Parameters:
expiresAt
- the time on or after which the JWT MUST NOT be accepted for processing- Returns:
- the
JwtClaimsSet.Builder
-
notBefore
Sets the not before(nbf)
claim, which identifies the time before which the JWT MUST NOT be accepted for processing.- Parameters:
notBefore
- the time before which the JWT MUST NOT be accepted for processing- Returns:
- the
JwtClaimsSet.Builder
-
issuedAt
Sets the issued at(iat)
claim, which identifies the time at which the JWT was issued.- Parameters:
issuedAt
- the time at which the JWT was issued- Returns:
- the
JwtClaimsSet.Builder
-
id
Sets the JWT ID(jti)
claim, which provides a unique identifier for the JWT.- Parameters:
jti
- the unique identifier for the JWT- Returns:
- the
JwtClaimsSet.Builder
-
claim
Sets the claim.- Parameters:
name
- the claim namevalue
- the claim value- Returns:
- the
JwtClaimsSet.Builder
-
claims
AConsumer
to be provided access to the claims allowing the ability to add, replace, or remove.- Parameters:
claimsConsumer
- aConsumer
of the claims
-
build
Builds a newJwtClaimsSet
.- Returns:
- a
JwtClaimsSet
-