Interface RequestHttpObject<T extends org.opensaml.saml.saml2.core.RequestAbstractType>

All Known Implementing Classes:
PostRequestHttpObject, RedirectRequestHttpObject

public interface RequestHttpObject<T extends org.opensaml.saml.saml2.core.RequestAbstractType>
Defines an interface that represents an object that holds data necessary for the SP application to transmit a request message to an IdP.
Author:
Martin Lindström (martin@idsec.se)
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the URL to where we are sending the request.
    Returns a mapping of header names and values that should be used when sending the request.
    Returns the HTTP method that should be used to send the request, via the user agent, to the Identity Provider.
    Returns the actual request (for easy access to its elements).
    If the getMethod() returns "POST" the request should be posted to the Identity Provider.
    Returns the complete URL that the SP application should use when the user agent is sent to the Identity Provider.
  • Method Details

    • getSendUrl

      String getSendUrl()
      Returns the complete URL that the SP application should use when the user agent is sent to the Identity Provider.

      For a redirect, this URL could look something like: https://www.theidp.com/auth?SAMLRequest=<encoded request>&RelayState=abcd.

      Note: Additional query parameters may be added to the URL by the using system.
      Returns:
      the URL to use when sending the user to the Identity Provider
    • getDestinationUrl

      String getDestinationUrl()
      Returns the URL to where we are sending the request. If the method is "POST", this will be the same value as for getSendUrl(), and if the method is "GET", the value is just the destination and not the query parameters.
      Returns:
      the destination URL
    • getMethod

      String getMethod()
      Returns the HTTP method that should be used to send the request, via the user agent, to the Identity Provider. Possible values for this implementation is "GET" (redirect) and "POST".
      Returns:
      the HTTP method to use
    • getRequestParameters

      Map<String,String> getRequestParameters()
      If the getMethod() returns "POST" the request should be posted to the Identity Provider. The request parameters are represented using a Map where the entries represent parameter names and values.

      Note: for the "GET" method this method returns the query parameters that are part of getSendUrl().

      The parameter values are not URL-encoded.

      Returns:
      a Map holding the request parameters (POST body or query parameters)
    • getHttpHeaders

      Map<String,String> getHttpHeaders()
      Returns a mapping of header names and values that should be used when sending the request.
      Returns:
      HTTP headers
    • getRequest

      T getRequest()
      Returns the actual request (for easy access to its elements).
      Returns:
      the request