Interface Authentication

    • Method Detail

      • matches

        boolean matches​(java.lang.String type,
                        java.net.URI uri,
                        java.lang.String realm)
        Deprecated.
        Matches Authentications based on the given parameters
        Parameters:
        type - the Authentication type such as "Basic" or "Digest"
        uri - the request URI
        realm - the authentication realm as provided in the WWW-Authenticate response header
        Returns:
        true if this authentication matches, false otherwise
      • authenticate

        Authentication.Result authenticate​(Request request,
                                           ContentResponse response,
                                           Authentication.HeaderInfo headerInfo,
                                           Attributes context)
        Deprecated.
        Executes the authentication mechanism for the given request, returning a Authentication.Result that can be used to actually authenticate the request via Authentication.Result.apply(Request).

        If a request for "/secure" returns a Authentication.Result, then the result may be used for other requests such as "/secure/foo" or "/secure/bar", unless those resources are protected by other realms.

        Parameters:
        request - the request to execute the authentication mechanism for
        response - the 401 response obtained in the previous attempt to request the protected resource
        headerInfo - the WWW-Authenticate (or Proxy-Authenticate) header chosen for this authentication (among the many that the response may contain)
        context - the conversation context in case the authentication needs multiple exchanges to be completed and information needs to be stored across exchanges
        Returns:
        the authentication result, or null if the authentication could not be performed