Class SAML2Proxy


  • public final class SAML2Proxy
    extends Object
    Called on the way back into the SAML2 Authentication Module by the saml2AuthAssertionConsumer jsp.
    • Field Detail

      • RESPONSE_KEY

        public static final String RESPONSE_KEY
        Key for looking up the response key in the http query string.
        See Also:
        Constant Field Values
      • DEFAULT_ERROR_MESSAGE

        public static final String DEFAULT_ERROR_MESSAGE
        Default message to display when we can't even forward an error back to the Authentication Module.
        See Also:
        Constant Field Values
      • BAD_REQUEST

        public static final String BAD_REQUEST
        Constant to indicate the Proxy received a bad request.
        See Also:
        Constant Field Values
      • MISSING_COOKIE

        public static final String MISSING_COOKIE
        Constant to indicate the Proxy did not find the expected cookie.

        No longer produced. It was only ever reached when the load balancer cookie bounce fired - which needs a multi server platform and com.sun.identity.federation.cookieHashRedirectEnabled=true, off by default - and that case now answers the request instead of failing it. Kept because it is part of the published error vocabulary and an older server in the same site can still emit it.

        See Also:
        Constant Field Values
      • MISSING_META_MANAGER

        public static final String MISSING_META_MANAGER
        Constant to indicate that the proxy was unable to locate the meta manager.
        See Also:
        Constant Field Values
      • META_DATA_ERROR

        public static final String META_DATA_ERROR
        Constant to indicate that the proxy was unable to extract data from the meta manager.
        See Also:
        Constant Field Values
      • SAML_GET_RESPONSE_ERROR

        public static final String SAML_GET_RESPONSE_ERROR
        Constant to indicate that the proxy was unable to extract the SAML response.
        See Also:
        Constant Field Values
      • SAML_VERIFY_RESPONSE_ERROR

        public static final String SAML_VERIFY_RESPONSE_ERROR
        Constant to indicate that the proxy was unable to verify the response.
        See Also:
        Constant Field Values
      • SAML_FAILOVER_DISABLED_ERROR

        public static final String SAML_FAILOVER_DISABLED_ERROR
        Constant to indicate that SAML failover was not enabled as required.
        See Also:
        Constant Field Values
      • ERROR_PARAM_KEY

        public static final String ERROR_PARAM_KEY
        Key for looking up the boolean error state from the http query string.
        See Also:
        Constant Field Values
      • ERROR_CODE_PARAM_KEY

        public static final String ERROR_CODE_PARAM_KEY
        Key for looking up the error type from the http query string.
        See Also:
        Constant Field Values
      • ERROR_MESSAGE_PARAM_KEY

        public static final String ERROR_MESSAGE_PARAM_KEY
        Key for looking up the error message from the http query string.
        See Also:
        Constant Field Values
    • Method Detail

      • processSamlResponse

        public static void processSamlResponse​(jakarta.servlet.http.HttpServletRequest request,
                                               jakarta.servlet.http.HttpServletResponse response,
                                               PrintWriter out)
                                        throws IOException
        Processes the SAML response for the SAML2 authentication module and then directs the user back to the authentication process differently for XUI and non-XUI cases.
        Parameters:
        request - The HTTP request.
        response - The HTTP response.
        out - The PrintWriter.
        Throws:
        IOException - If there was an IO error while retrieving the SAML response.
      • getUrlWithKey

        protected static String getUrlWithKey​(jakarta.servlet.http.HttpServletRequest req,
                                              String key)
        Auto-submits the passed-in parameters to the authentication module, as taken from a known cookie location in the request.
        Parameters:
        req - The request.
        key - The key to reference.
        Returns:
        An HTML form to render to the user's user-agent.
      • getUrlWithError

        protected static String getUrlWithError​(jakarta.servlet.http.HttpServletRequest req,
                                                String errorType)
        Creates a post form for forwarding error response information to the SAML2 authentication module.
        Parameters:
        req - The request.
        errorType - The Error type that has occurred.
        Returns:
        An HTML form to render to the user's user-agent.
      • getUrlWithError

        protected static String getUrlWithError​(jakarta.servlet.http.HttpServletRequest req,
                                                String errorType,
                                                String messageDetail)
        Creates a post form for forwarding error response information to the SAML2 authentication module.
        Parameters:
        req - The request.
        errorType - The Error type that has occurred.
        messageDetail - a text description of the message.
        Returns:
        An HTML form to render to the user's user-agent.
      • getAutoSubmittingFormHtml

        protected static String getAutoSubmittingFormHtml​(String value)
        Returns the HTML for an auto submitting form that will be submitted to the provided Url.
        Parameters:
        value - The form's action.
        Returns:
        The HTML for the auto submitting form.