Class Saml2ResponseSender

java.lang.Object
se.swedenconnect.spring.saml.idp.response.Saml2ResponseSender

public class Saml2ResponseSender extends Object
A class for posting back a SAML Response to the client (Service Provider).
Author:
Martin Lindström
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    encodeResponse(org.opensaml.saml.saml2.core.Response samlResponse)
    Encodes the supplied Response 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 the RelayState variable.
    void
    Assigns the ResponsePage to use when posting back the user.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the RelayState variable.
      Parameters:
      httpServletRequest - the HTTP servlet request
      httpServletResponse - the HTTP servlet response
      destinationUrl - the destination URL
      response - the SAML response
      relayState - the RelayState, may be null
      Throws:
      UnrecoverableSaml2IdpException - for send errors
    • setResponsePage

      public void setResponsePage(ResponsePage responsePage)
      Assigns the ResponsePage to use when posting back the user. The default is DefaultResponsePage.
      Parameters:
      responsePage - the ResponsePage
    • encodeResponse

      protected String encodeResponse(org.opensaml.saml.saml2.core.Response samlResponse) throws UnrecoverableSaml2IdpException
      Encodes the supplied Response 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