Class Saml2ResponseSender
java.lang.Object
se.swedenconnect.spring.saml.idp.response.Saml2ResponseSender
A class for posting back a SAML
Response to the client (Service Provider).- Author:
- Martin Lindström
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringencodeResponse(Response samlResponse) Encodes the suppliedResponsemessage for being included in na HTML form.voidsend(jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse, String destinationUrl, Response response, String relayState) Directs the user agent to a page that issues na HTML POST containing the SAML response, and optionally, also theRelayStatevariable.voidsetResponsePage(ResponsePage responsePage) Assigns theResponsePageto use when posting back the user.
-
Constructor Details
-
Saml2ResponseSender
public Saml2ResponseSender()
-
-
Method Details
-
send
public void send(jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse, String destinationUrl, Response response, String relayState) throws UnrecoverableSaml2IdpException Directs the user agent to a page that issues na HTML POST containing the SAML response, and optionally, also theRelayStatevariable.- Parameters:
httpServletRequest- the HTTP servlet requesthttpServletResponse- the HTTP servlet responsedestinationUrl- the destination URLresponse- the SAML responserelayState- theRelayState, may benull- Throws:
UnrecoverableSaml2IdpException- for send errors
-
setResponsePage
Assigns theResponsePageto use when posting back the user. The default isDefaultResponsePage.- Parameters:
responsePage- theResponsePage
-
encodeResponse
Encodes the suppliedResponsemessage for being included in na HTML form.- Parameters:
samlResponse- the response message- Returns:
- the Base64-encoding of the message
- Throws:
UnrecoverableSaml2IdpException- for encoding errors
-