Class DefaultResponsePage

java.lang.Object
se.swedenconnect.spring.saml.idp.response.DefaultResponsePage
All Implemented Interfaces:
ResponsePage

public class DefaultResponsePage extends Object implements ResponsePage
A helper for creating the HTML page that posts the response back to the Service Provider.
Author:
Martin Lindström
  • Constructor Details

    • DefaultResponsePage

      public DefaultResponsePage()
  • Method Details

    • sendResponse

      public void sendResponse(jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse, String destination, String samlResponse, String relayState) throws IOException
      Sends a SAML Response message to the given destination.
      Specified by:
      sendResponse in interface ResponsePage
      Parameters:
      httpServletRequest - the HTTP servlet request (in case the implementation wants to redirect the user)
      httpServletResponse - the HTTP servlet response
      destination - the destination URL
      samlResponse - the Base64-encoded SAML response message
      relayState - the relay state (may be null)
      Throws:
      IOException - for errors writing to the servlet response
    • generateResponsePage

      public static String generateResponsePage(String destination, String samlResponse, String relayState)
      Generates an HTML page for posting the SAML response message.
      Parameters:
      destination - the destination URL
      samlResponse - the Base64-encoded SAML response message
      relayState - the relay state (may be null)
      Returns:
      a String containing the contents of the HTML page