Class HttpServletAuthParam

  • All Implemented Interfaces:
    AuthParam

    public class HttpServletAuthParam
    extends Object
    implements AuthParam
    An HTTP Servlet authentication parameter that encapsulates HTTP Servlet request and response objects.

    HttpServletAuthParam may be created with null request or response objects. The following table describes when it is appropriate to pass null:

                                            Request   Response
                                            -------   --------
    
     ClientAuthModule.secureRequest         non-null  null
     ClientAuthModule.validateResponse      null      non-null
    
     ServerAuthModule.validateRequest       non-null  null
     ServerAuthModule.secureResponse        null      non-null
     

    As noted above, in the case of ServerAuthModule.validateRequest the module receives a null response object. If the implementation of validateRequest encounters an authentication error, it may construct the appropriate response object itself and set it into the HttpServletAuthParam via the setResponse method.

    Version:
    %I%, %G%
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpServletAuthParam​(jakarta.security.auth.message.MessageInfo messageInfo)
      Create an HttpServletAuthParam with MessageInfo object.
      HttpServletAuthParam​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Create an HttpServletAuthParam with HTTP request and response objects.
    • Constructor Detail

      • HttpServletAuthParam

        public HttpServletAuthParam​(jakarta.servlet.http.HttpServletRequest request,
                                    jakarta.servlet.http.HttpServletResponse response)
        Create an HttpServletAuthParam with HTTP request and response objects.
        Parameters:
        request - the HTTP Servlet request object, or null.
        response - the HTTP Servlet response object, or null.
      • HttpServletAuthParam

        public HttpServletAuthParam​(jakarta.security.auth.message.MessageInfo messageInfo)
        Create an HttpServletAuthParam with MessageInfo object.
        Parameters:
        messageInfo -
    • Method Detail

      • getRequest

        public jakarta.servlet.http.HttpServletRequest getRequest()
        Get the HTTP Servlet request object.
        Returns:
        the HTTP Servlet request object, or null.
      • getResponse

        public jakarta.servlet.http.HttpServletResponse getResponse()
        Get the HTTP Servlet response object.
        Returns:
        the HTTP Servlet response object, or null.
      • setResponse

        public void setResponse​(jakarta.servlet.http.HttpServletResponse response)
        Set a new HTTP Servlet response object.

        If a response has already been set (it is non-null), this method returns. The original response is not overwritten.

        Parameters:
        response - the HTTP Servlet response object.
        Throws:
        IllegalArgumentException - if the specified response is null.
      • getOperation

        public String getOperation()
        Get the operation related to the encapsulated HTTP Servlet request and response objects.
        Returns:
        the operation related to the encapsulated request and response objects, or null.