Interface AuthorizationProcessor

All Known Implementing Classes:
BasicAuthorizationProcessor, DigestAuthorizationProcessor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AuthorizationProcessor
A processor for creating a value for the HttpHeaders.AUTHORIZATION header. The createRequestHeader(ClientRequestContext) is first invoked to see if we can create a header without first making the request. If not, e.g. null is returned, then the createRequestHeader(ClientRequestContext, List) is invoked.
Author:
James R. Perkins
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    createRequestHeader(jakarta.ws.rs.client.ClientRequestContext requestContext)
    Creates a value for the HttpHeaders.AUTHORIZATION header.
    createRequestHeader(jakarta.ws.rs.client.ClientRequestContext requestContext, List<String> authenticateHeader)
    Creates a value for the HttpHeaders.AUTHORIZATION header.
    default void
    reset(jakarta.ws.rs.client.ClientRequestContext requestContext)
    Processors may require a reset if authorization fails.
  • Method Details

    • createRequestHeader

      String createRequestHeader(jakarta.ws.rs.client.ClientRequestContext requestContext, List<String> authenticateHeader)
      Creates a value for the HttpHeaders.AUTHORIZATION header.
      Parameters:
      requestContext - the client request context
      authenticateHeader - the HttpHeaders.WWW_AUTHENTICATE value
      Returns:
      the value for the HttpHeaders.AUTHORIZATION header or
      invalid @link
      {@link null
      } if one could not be created by this processor
    • createRequestHeader

      default String createRequestHeader(jakarta.ws.rs.client.ClientRequestContext requestContext)
      Creates a value for the HttpHeaders.AUTHORIZATION header.
      Parameters:
      requestContext - the client request context
      Returns:
      the value for the HttpHeaders.AUTHORIZATION header or
      invalid @link
      {@link null
      } if one could not be created by this processor
    • reset

      default void reset(jakarta.ws.rs.client.ClientRequestContext requestContext)
      Processors may require a reset if authorization fails. By default, this does nothing.
      Parameters:
      requestContext - the client request context