Class HttpPostRedirect

  • @Deprecated
    public class HttpPostRedirect
    extends Object
    Class is deprecated and may be removed in the future. Use org.keycloak.saml.BaseSAML2BindingBuilder#buildHtml instead
    Helper class to do a browser redirect via a POST.
    $Revision: 1 $
    Bill Burke
    • Constructor Detail

      • HttpPostRedirect

        public HttpPostRedirect()
    • Method Detail

      • buildHtml

        public String buildHtml​(String title,
                                String actionUrl,
                                Map<String,​String> params)
        Generate an HTML page that does a browser redirect via a POST. The HTML document uses Javascript to automatically submit a FORM post when loaded. This is similar to what the SAML Post Binding does. Here's an example
           <BODY Onload="document.forms[0].submit()">
               <FORM METHOD="POST" ACTION="actionUrl">
                   <INPUT TYPE="HIDDEN" NAME="param" VALUE="value"/>
                       <P>JavaScript is disabled. We strongly recommend to enable it. Click the button below to continue.</P>
                       <INPUT TYPE="SUBMIT" VALUE="CONTINUE"/>
        title - may be null. Just the title of the HTML document
        actionUrl - URL to redirect to
        params - must be encoded so that they can be placed in an HTML form hidden INPUT field value