Class DefaultResponsePage
java.lang.Object
se.swedenconnect.spring.saml.idp.response.DefaultResponsePage
- All Implemented Interfaces:
ResponsePage
A helper for creating the HTML page that posts the response back to the Service Provider.
- Author:
- Martin Lindström
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
generateResponsePage
(String destination, String samlResponse, String relayState) Generates an HTML page for posting the SAML response message.void
sendResponse
(jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse, String destination, String samlResponse, String relayState) Sends a SAML Response message to the given destination.
-
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 interfaceResponsePage
- Parameters:
httpServletRequest
- the HTTP servlet request (in case the implementation wants to redirect the user)httpServletResponse
- the HTTP servlet responsedestination
- the destination URLsamlResponse
- the Base64-encoded SAML response messagerelayState
- 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 URLsamlResponse
- the Base64-encoded SAML response messagerelayState
- the relay state (may be null)- Returns:
- a String containing the contents of the HTML page
-