Class BaseEndpoint

    • Constructor Summary

      Constructors 
      Constructor Description
      BaseEndpoint()  
    • Constructor Detail

      • BaseEndpoint

        public BaseEndpoint()
    • Method Detail

      • onError

        protected void onError​(javax.ws.rs.WebApplicationException exception)
        Called when the internal request handler raises an exception. The default implementation of this method does nothing. Override this method as necessary.
        Parameters:
        exception - An exception thrown by the internal request handler.
      • extractClientCertificateChain

        protected String[] extractClientCertificateChain​(javax.servlet.http.HttpServletRequest request)
        Utility method for extracting a single client certificate from the default certificate extractors. First checks the request itself for an attached certificate using javax.servlet.request.X509Certificate, then checks the incoming request headers for reverse-proxied certificates using default headers.
        Parameters:
        request - The incoming HTTP request to search for the client's certificate.
        Returns:
        The client's mutual TLS certificate.
        Since:
        2.8
        See Also:
        ClientCertificateExtractor
      • extractClientCertificate

        protected String extractClientCertificate​(javax.servlet.http.HttpServletRequest request)
        Utility method for extracting a single client certificate from the default certificate extractors. Calls extractClientCertificateChain and returns the first entry in the array, if any, null otherwise.
        Parameters:
        request - The incoming HTTP request to search for the client's certificate.
        Returns:
        The client's mutual TLS certificate.
        Since:
        2.8
      • takeAttribute

        protected Object takeAttribute​(javax.servlet.http.HttpSession session,
                                       String key)
        Get the value of an attribute from the given session and remove the attribute from the session after the retrieval.
        Parameters:
        session - The session from which the value of the attribute is extracted.
        key - The key associated with the target attribute.
        Returns:
        The value of the attribute associated with the given key.
        Since:
        2.18
      • extractHeadersAsPairs

        protected com.authlete.common.dto.Pair[] extractHeadersAsPairs​(javax.servlet.http.HttpServletRequest request)
        Extract headers in the HTTP request as a Pair array.
        Parameters:
        request - An HTTP request.
        Returns:
        A Pair array where each element represents a pair of header name and header value. If the given HTTP request contains no headers, an empty array is returned.
        Since:
        2.80