Class WWWAuthenticationProtocolHandler

java.lang.Object
org.eclipse.jetty.client.AuthenticationProtocolHandler
org.eclipse.jetty.client.WWWAuthenticationProtocolHandler
All Implemented Interfaces:
ProtocolHandler

public class WWWAuthenticationProtocolHandler extends AuthenticationProtocolHandler

A protocol handler that handles the 401 response code in association with the WWW-Authenticate header.

See Also:
  • Field Details

  • Constructor Details

    • WWWAuthenticationProtocolHandler

      public WWWAuthenticationProtocolHandler(HttpClient client)
    • WWWAuthenticationProtocolHandler

      public WWWAuthenticationProtocolHandler(HttpClient client, int maxContentLength)
  • Method Details

    • getName

      public String getName()
      Returns:
      a unique name among protocol handlers
    • accept

      public boolean accept(Request request, Response response)
      Description copied from interface: ProtocolHandler

      Inspects the given request and response to detect whether this protocol handler should handle them.

      For example, a redirect protocol handler can inspect the response code and return true if it is a redirect response code.

      This method is being called just after the response line has been parsed, and before the response headers are available.

      Parameters:
      request - the request to accept
      response - the response to accept
      Returns:
      true if this protocol handler can handle the given request and response
    • getAuthenticateHeader

      protected org.eclipse.jetty.http.HttpHeader getAuthenticateHeader()
      Specified by:
      getAuthenticateHeader in class AuthenticationProtocolHandler
    • getAuthorizationHeader

      protected org.eclipse.jetty.http.HttpHeader getAuthorizationHeader()
      Specified by:
      getAuthorizationHeader in class AuthenticationProtocolHandler
    • getAuthenticationURI

      protected URI getAuthenticationURI(Request request)
      Specified by:
      getAuthenticationURI in class AuthenticationProtocolHandler
    • getAuthenticationAttribute

      protected String getAuthenticationAttribute()
      Specified by:
      getAuthenticationAttribute in class AuthenticationProtocolHandler