Interface AsyncAuthenticator<T>


public interface AsyncAuthenticator<T>
Asynchronous authenticator.
Author:
Tim Boudreau
  • Method Summary

    Modifier and Type
    Method
    Description
    authenticate(com.mastfrog.acteur.util.RequestID rid, HttpEvent evt, String token)
    Authenticate a request, returning a completion stage which will resume the acteur chain when completed.
    The type of the user object that will be inside the authentication result
    default String
    validate(HttpEvent evt, String token)
    Validate an incoming authenticated request.
  • Method Details

    • validate

      default String validate(HttpEvent evt, String token)
      Validate an incoming authenticated request. This is called synchronously before attempting asynchronous authentication, in order to reject requests that are obviously invalid.
      Parameters:
      evt - The event
      token - The token (the substring of the header after 'bearer ').
      Returns:
      An error string if validation fails
    • authenticate

      EnhCompletionStage<AuthenticationResult<T>> authenticate(com.mastfrog.acteur.util.RequestID rid, HttpEvent evt, String token)
      Authenticate a request, returning a completion stage which will resume the acteur chain when completed.
      Parameters:
      rid - The request id
      evt - The event
      token - The token from the authorization header
      Returns:
      A completable future
    • type

      Class<T> type()
      The type of the user object that will be inside the authentication result
      Returns:
      A type