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
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
encodeResponse
(org.opensaml.saml.saml2.core.Response samlResponse) Encodes the suppliedResponse
message for being included in na HTML form.void
send
(jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse, String destinationUrl, org.opensaml.saml.saml2.core.Response response, String relayState) Directs the user agent to a page that issues na HTML POST containing the SAML response, and optionally, also theRelayState
variable.void
setResponsePage
(ResponsePage responsePage) Assigns theResponsePage
to 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, org.opensaml.saml.saml2.core.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 theRelayState
variable.- 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 theResponsePage
to use when posting back the user. The default isDefaultResponsePage
.- Parameters:
responsePage
- theResponsePage
-
encodeResponse
protected String encodeResponse(org.opensaml.saml.saml2.core.Response samlResponse) throws UnrecoverableSaml2IdpException Encodes the suppliedResponse
message for being included in na HTML form.- Parameters:
samlResponse
- the response message- Returns:
- the Base64-encoding of the message
- Throws:
UnrecoverableSaml2IdpException
- for encoding errors
-