Interface HttpAuthenticationHandler

All Known Implementing Classes:
HttpBasicAuthenticationHandler, HttpNoAuthenticationHandler, HttpSharedTokenOrPasswordAuthenticationHandler

public interface HttpAuthenticationHandler
Represents an Authentication Handler for an HttpHandler
Author:
gmt2001
  • Method Details

    • checkAuthorization

      boolean checkAuthorization(ChannelHandlerContext ctx, FullHttpRequest req)
      Checks if the given FullHttpRequest is a valid authentication request, or if the underlying Channel has already been authenticated When returning false, this method MUST also send either an 401 Unauthorized, a Header Location, or an error page back to the client
      Parameters:
      ctx - The ChannelHandlerContext of the session
      req - The FullHttpRequest to check
      Returns:
      otherwise
    • isAuthorized

      boolean isAuthorized(ChannelHandlerContext ctx, FullHttpRequest req)
      Checks if the given FullHttpRequest is a valid authentication request, or if the underlying Channel has already been authenticated When returning false, this method MUST NOT send a response to the client
      Parameters:
      ctx - The ChannelHandlerContext of the session
      req - The FullHttpRequest to check
      Returns:
      otherwise
    • isAuthorized

      boolean isAuthorized(ChannelHandlerContext ctx, HttpHeaders headers)
      Checks if the given HttpHeaders contain a valid authorization, or if the underlying Channel has already been authenticated When returning false, this method MUST NOT send a response to the client
      Parameters:
      ctx - The ChannelHandlerContext of the session
      headers - The HttpHeaders to check
      Returns:
      otherwise
    • isAuthorized

      boolean isAuthorized(String user, String pass)
      Checks if the given username and password is a valid When returning false, this method MUST NOT send a response to the client
      Parameters:
      user - The username
      pass - The password
      Returns:
      otherwise
    • invalidateAuthorization

      void invalidateAuthorization(ChannelHandlerContext ctx, FullHttpRequest req)
      Invalidates the authentication of the specified ChannelHandlerContext, if supported by the authentication handler
      Parameters:
      ctx - The ChannelHandlerContext of the session
      req - The FullHttpRequest
      Throws:
      UnsupportedOperationException - Thrown if the selected authentication handler does not support this operation