T - the type of mutatorpublic interface ClaimsMutator<T extends ClaimsMutator<T>>
Claims instance.JwtBuilder,
Claims| Modifier and Type | Interface and Description |
|---|---|
static interface |
ClaimsMutator.AudienceCollection<P>
A
NestedCollection for setting audience() values that also allows overriding the collection
to be a single string value for legacy JWT recipients if necessary. |
| Modifier and Type | Method and Description |
|---|---|
ClaimsMutator.AudienceCollection<T> |
audience()
Configures the JWT
aud (audience) Claim
set, quietly ignoring any null, empty, whitespace-only, or existing value already in the set. |
T |
expiration(Date exp)
Sets the JWT
exp (expiration) timestamp claim. |
T |
id(String jti)
Sets the JWT
jti (JWT ID) claim. |
T |
issuedAt(Date iat)
Sets the JWT
iat (issued at) timestamp claim. |
T |
issuer(String iss)
Sets the JWT
iss (issuer) claim. |
T |
notBefore(Date nbf)
Sets the JWT
nbf (not before) timestamp claim. |
T |
setAudience(String aud)
Deprecated.
since 0.12.0 in favor of
audience(). This method will be removed before
the JJWT 1.0 release. |
T |
setExpiration(Date exp)
Deprecated.
since 0.12.0 in favor of the shorter and more modern builder-style named
expiration(Date). This method will be removed before the JJWT 1.0 release. |
T |
setId(String jti)
Deprecated.
since 0.12.0 in favor of the shorter and more modern builder-style named
id(String). This method will be removed before the JJWT 1.0 release. |
T |
setIssuedAt(Date iat)
Deprecated.
since 0.12.0 in favor of the shorter and more modern builder-style named
issuedAt(Date). This method will be removed before the JJWT 1.0 release. |
T |
setIssuer(String iss)
Deprecated.
since 0.12.0 in favor of the shorter and more modern builder-style named
issuer(String). This method will be removed before the JJWT 1.0 release. |
T |
setNotBefore(Date nbf)
Deprecated.
since 0.12.0 in favor of the shorter and more modern builder-style named
notBefore(Date). This method will be removed before the JJWT 1.0 release. |
T |
setSubject(String sub)
Deprecated.
since 0.12.0 in favor of the shorter and more modern builder-style named
subject(String). This method will be removed before the JJWT 1.0 release. |
T |
subject(String sub)
Sets the JWT
sub (subject) claim. |
@Deprecated T setIssuer(String iss)
issuer(String). This method will be removed before the JJWT 1.0 release.iss (issuer) claim. A null value will remove the property from the JSON Claims map.iss - the JWT iss value or null to remove the property from the JSON map.Claims instance for method chaining.T issuer(String iss)
iss (issuer) claim. A null value will remove the property from the JSON Claims map.iss - the JWT iss value or null to remove the property from the JSON map.Claims instance for method chaining.@Deprecated T setSubject(String sub)
subject(String). This method will be removed before the JJWT 1.0 release.sub (subject) claim. A null value will remove the property from the JSON Claims map.sub - the JWT sub value or null to remove the property from the JSON map.Claims instance for method chaining.T subject(String sub)
sub (subject) claim. A null value will remove the property from the JSON Claims map.sub - the JWT sub value or null to remove the property from the JSON map.Claims instance for method chaining.@Deprecated T setAudience(String aud)
audience(). This method will be removed before
the JJWT 1.0 release.aud (audience)
claim as a single String, NOT a String array. This method exists only for producing
JWTs sent to legacy recipients that are unable to interpret the aud value as a JSON String Array; it is
strongly recommended to avoid calling this method whenever possible and favor the
audience().add(String) and
add(Collection) methods instead, as they ensure a single
deterministic data type for recipients.aud - the JWT aud value or null to remove the property from the JSON map.Claims instance for method chaining.ClaimsMutator.AudienceCollection<T> audience()
aud (audience) Claim
set, quietly ignoring any null, empty, whitespace-only, or existing value already in the set.AudienceCollection to use for aud configuration.AudienceCollection,
AudienceCollection.single(String)@Deprecated T setExpiration(Date exp)
expiration(Date). This method will be removed before the JJWT 1.0 release.exp (expiration) timestamp claim. A null value will remove the property from the
JSON Claims map.
A JWT obtained after this timestamp should not be used.
exp - the JWT exp value or null to remove the property from the JSON map.Claims instance for method chaining.T expiration(Date exp)
exp (expiration) timestamp claim. A null value will remove the property from the
JSON Claims map.
A JWT obtained after this timestamp should not be used.
exp - the JWT exp value or null to remove the property from the JSON map.Claims instance for method chaining.@Deprecated T setNotBefore(Date nbf)
notBefore(Date). This method will be removed before the JJWT 1.0 release.nbf (not before) timestamp claim. A null value will remove the property from the
JSON Claims map.
A JWT obtained before this timestamp should not be used.
nbf - the JWT nbf value or null to remove the property from the JSON map.Claims instance for method chaining.T notBefore(Date nbf)
nbf (not before) timestamp claim. A null value will remove the property from the
JSON Claims map.
A JWT obtained before this timestamp should not be used.
nbf - the JWT nbf value or null to remove the property from the JSON map.Claims instance for method chaining.@Deprecated T setIssuedAt(Date iat)
issuedAt(Date). This method will be removed before the JJWT 1.0 release.iat (issued at) timestamp claim. A null value will remove the property from the
JSON Claims map.
The value is the timestamp when the JWT was created.
iat - the JWT iat value or null to remove the property from the JSON map.Claims instance for method chaining.T issuedAt(Date iat)
iat (issued at) timestamp claim. A null value will remove the property from the
JSON Claims map.
The value is the timestamp when the JWT was created.
iat - the JWT iat value or null to remove the property from the JSON map.Claims instance for method chaining.@Deprecated T setId(String jti)
id(String). This method will be removed before the JJWT 1.0 release.jti (JWT ID) claim. A null value will remove the property from the JSON Claims map.
This value is a CaSe-SenSiTiVe unique identifier for the JWT. If specified, this value MUST be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object. The ID can be used to prevent the JWT from being replayed.
jti - the JWT jti value or null to remove the property from the JSON map.Claims instance for method chaining.T id(String jti)
jti (JWT ID) claim. A null value will remove the property from the JSON Claims map.
This value is a CaSe-SenSiTiVe unique identifier for the JWT. If specified, this value MUST be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object. The ID can be used to prevent the JWT from being replayed.
jti - the JWT jti value or null to remove the property from the JSON map.Claims instance for method chaining.Copyright © 2014–2024 jsonwebtoken.io. All rights reserved.