如何在WSO2 IS 5.5.0中移除SAML SSO重定向页面
Hey there! I’ve tackled this exact problem before—let’s eliminate that intermediate redirect page showing the "You are now redirected to URL If the redirection fails, please click the post button" message. Here’s a straightforward step-by-step guide:
Step 1: Locate the responsible JSP file
The page you’re seeing is generated by a JSP in the default authentication endpoint. Head to<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/jsps/and opensamlsso_post.jsp—this is the file that renders the prompt and handles the SAML response submission.Step 2: Rewrite the JSP for instant, invisible redirect
By default, this JSP displays the prompt and adds a slight delay before submitting the SAML response. To skip the prompt entirely, replace the entire content of the file with this minimal auto-submit code:<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <script type="text/javascript"> // Auto-submit the form the moment the page loads window.addEventListener('load', function() { document.forms[0].submit(); }); </script> </head> <body style="display: none;"> <form method="post" action="<%= request.getParameter("ACS_URL") %>"> <% String samlResponse = request.getParameter("SAMLResponse"); String relayState = request.getParameter("RelayState"); %> <input type="hidden" name="SAMLResponse" value="<%= samlResponse %>"/> <% if (relayState != null && !relayState.trim().isEmpty()) { %> <input type="hidden" name="RelayState" value="<%= relayState %>"/> <% } %> </form> </body> </html>The
display: nonestyle ensures no content is visible, and the script submits the form instantly without waiting for user input.Step 3: Restart WSO2 IS
Save your changes to the JSP file, then restart your WSO2 Identity Server instance. This ensures the modified authentication endpoint is loaded correctly.Test the flow
Run through your SAML SSO process again—you’ll now be redirected straight to your Demo page without seeing that intermediate prompt.
A quick note: If you’re using a custom authentication endpoint (instead of the default one), make sure you modify the corresponding samlsso_post.jsp in your custom web app directory instead.
内容的提问来源于stack exchange,提问作者Ompratap Singh

