Class SAML2Proxy
- java.lang.Object
-
- org.forgerock.openam.authentication.modules.saml2.SAML2Proxy
-
public final class SAML2Proxy extends Object
Called on the way back into the SAML2 Authentication Module by the saml2AuthAssertionConsumer jsp.
-
-
Field Summary
Fields Modifier and Type Field Description static StringBAD_REQUESTConstant to indicate the Proxy received a bad request.static StringDEFAULT_ERROR_MESSAGEDefault message to display when we can't even forward an error back to the Authentication Module.static StringERROR_CODE_PARAM_KEYKey for looking up the error type from the http query string.static StringERROR_MESSAGE_PARAM_KEYKey for looking up the error message from the http query string.static StringERROR_PARAM_KEYKey for looking up the boolean error state from the http query string.static StringMETA_DATA_ERRORConstant to indicate that the proxy was unable to extract data from the meta manager.static StringMISSING_COOKIEConstant to indicate the Proxy did not find the expected cookie.static StringMISSING_META_MANAGERConstant to indicate that the proxy was unable to locate the meta manager.static StringRESPONSE_KEYKey for looking up the response key in the http query string.static StringSAML_FAILOVER_DISABLED_ERRORConstant to indicate that SAML failover was not enabled as required.static StringSAML_GET_RESPONSE_ERRORConstant to indicate that the proxy was unable to extract the SAML response.static StringSAML_VERIFY_RESPONSE_ERRORConstant to indicate that the proxy was unable to verify the response.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static StringgetAutoSubmittingFormHtml(String value)Returns the HTML for an auto submitting form that will be submitted to the provided Url.protected static StringgetUrlWithError(jakarta.servlet.http.HttpServletRequest req, String errorType)Creates a post form for forwarding error response information to the SAML2 authentication module.protected static StringgetUrlWithError(jakarta.servlet.http.HttpServletRequest req, String errorType, String messageDetail)Creates a post form for forwarding error response information to the SAML2 authentication module.protected static StringgetUrlWithKey(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.static voidprocessSamlResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out)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.
-
-
-
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 IOExceptionProcesses 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- ThePrintWriter.- 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.
-
-