Class JwtValidator<T>
java.lang.Object
io.micronaut.security.token.jwt.validator.JwtValidator<T>
- Type Parameters:
T
- Request
A builder style class for validating JWT tokens against any number of provided
encryption or signature configurations and any claim validators.
- Since:
- 1.4.0
- Author:
- James Kleeh
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JwtValidator.Builder
builder()
Optional<com.nimbusds.jwt.JWT>
Validates the supplied token with any configurations and claim validators present.Optional<com.nimbusds.jwt.JWT>
Validates the supplied token with any configurations and claim validators present.
-
Method Details
-
validate
Validates the supplied token with any configurations and claim validators present.- Parameters:
token
- The JWT stringrequest
- HTTP Request- Returns:
- An optional JWT token if validation succeeds
-
validate
public Optional<com.nimbusds.jwt.JWT> validate(@NonNull @NonNull com.nimbusds.jwt.JWT token, @Nullable T request) Validates the supplied token with any configurations and claim validators present.- Parameters:
token
- The JWT tokenrequest
- The HTTP Request which contained the JWT token- Returns:
- An optional JWT token if validation succeeds
-
builder
- Returns:
- A new JWT validator builder
-