Interface TokenValidator<T>

Type Parameters:
T - Request
All Superinterfaces:
io.micronaut.core.order.Ordered
All Known Subinterfaces:
ReactiveJsonWebTokenValidator<T,R>
All Known Implementing Classes:
JwtTokenValidator

public interface TokenValidator<T> extends io.micronaut.core.order.Ordered
Responsible for token validation and claims retrieval.
Since:
1.0
Author:
Sergio del Amo
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull org.reactivestreams.Publisher<Authentication>
    validateToken(@NonNull String token, T request)
    Validates the provided token and returns the authentication state.

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder
  • Method Details

    • validateToken

      @NonNull @SingleResult @NonNull org.reactivestreams.Publisher<Authentication> validateToken(@NonNull @NonNull String token, @Nullable T request)
      Validates the provided token and returns the authentication state.
      Parameters:
      token - The token string
      request - The current request (or null)
      Returns:
      An authentication publisher. If the publisher emits an error, no further validators will be attempted and the validation will fail. If the publisher is empty, further validators will be attempted. If the publisher emits an authentication, that authentication will be used.