public static class JwtValidator.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
JwtValidator |
build()
Builds the
JwtValidator . |
JwtValidator.Builder |
claim(JsonPointer ptr,
JwtClaimConstraint<JsonValue> jwtClaimConstraint)
Adds a
JwtClaimConstraint on a claim. |
<T,E extends Exception> |
claim(String key,
Function<JsonValue,? extends T,E> transformer,
JwtClaimConstraint<T> jwtClaimConstraint)
Adds a
JwtClaimConstraint on a claim. |
JwtValidator.Builder |
claim(String key,
JwtClaimConstraint<JsonValue> jwtClaimConstraint)
Adds a
JwtClaimConstraint on a claim. |
JwtValidator.Builder |
claims(String key,
JwtClaimConstraint<String> jwtClaimConstraint)
Adds a
JwtClaimConstraint on a claim. |
<T> JwtValidator.Builder |
claimSet(String key,
Function<Optional<JwtClaimsSet>,Optional<T>> adapter,
JwtClaimConstraint<T> jwtClaimConstraint)
Adds a
JwtClaimConstraint on the claimSet. |
JwtValidator.Builder |
jwt(JwtConstraint jwtConstraint)
Adds a
JwtConstraint on the JWT. |
public <T,E extends Exception> JwtValidator.Builder claim(String key, Function<JsonValue,? extends T,E> transformer, JwtClaimConstraint<T> jwtClaimConstraint)
JwtClaimConstraint
on a claim.T
- The type of the jwtClaimConstraint.E
- The exception type.key
- The claim's key.transformer
- The transformer function to apply to the claim.jwtClaimConstraint
- The constraint to apply.public JwtValidator.Builder claim(String key, JwtClaimConstraint<JsonValue> jwtClaimConstraint)
JwtClaimConstraint
on a claim.key
- The claim's key or a pointer such forgerock/ssoToken, not null
.jwtClaimConstraint
- The constraint to apply on the claim.public JwtValidator.Builder claim(JsonPointer ptr, JwtClaimConstraint<JsonValue> jwtClaimConstraint)
JwtClaimConstraint
on a claim.ptr
- The JsonPointer
, such as forgerock/ssoToken, not null
.jwtClaimConstraint
- The constraint to apply on the claim.public JwtValidator.Builder claims(String key, JwtClaimConstraint<String> jwtClaimConstraint)
JwtClaimConstraint
on a claim.key
- The claim's key.jwtClaimConstraint
- The constraint to apply on the claim.public <T> JwtValidator.Builder claimSet(String key, Function<Optional<JwtClaimsSet>,Optional<T>> adapter, JwtClaimConstraint<T> jwtClaimConstraint)
JwtClaimConstraint
on the claimSet.T
- The type of result of the function.key
- The name of the claim's key.adapter
- The adapter function to apply.jwtClaimConstraint
- The constraint to apply on the claimSet.public JwtValidator.Builder jwt(JwtConstraint jwtConstraint)
JwtConstraint
on the JWT.jwtConstraint
- The constraint to apply on the JWT.public JwtValidator build()
JwtValidator
.Copyright 2011-2017 ForgeRock AS.