Class SamlUtils

java.lang.Object
com.webmethods.caf.wsserver.auth.saml.SamlUtils
All Implemented Interfaces:
ISamlConstants

public class SamlUtils extends Object implements ISamlConstants
Utility methods for miscellaneous SAML specific and other functionality.
  • Field Details

    • requestID

      protected static int requestID
  • Constructor Details

    • SamlUtils

      public SamlUtils()
  • Method Details

    • verifyAssertion

      public static String verifyAssertion(org.opensaml.saml1.core.Assertion samlAssertion)
      Verify a Assertion object retrieved from the SAML security provider todo check digital signature
      Parameters:
      samlAssertion - the Assertion object
      Returns:
      the asserted user DN
    • getSamlAssertion

      public static org.opensaml.saml1.core.Assertion getSamlAssertion(String securityProviderEndpoint, String samlArtifact)
      See Also:
    • getSamlAssertion

      public static org.opensaml.saml1.core.Assertion getSamlAssertion(org.opensaml.saml1.core.Response samlResponse)
      Return the SAML assertion object present in the SAML response.
      Parameters:
      samlResponse - Response object received from the SAML Server.
      Returns:
      Assertion object present within the Response object. Only one assertion object per response is currently supported.
    • getSamlResponse

      public static org.opensaml.saml1.core.Response getSamlResponse(String securityProviderEndpoint, String samlArtifactString)
      The specified SAML artifact is passed to the SAML server and the SAML response object obtained from the SAML security provider.
      Parameters:
      securityProviderEndpoint - URL of the security provider endpoint (e.g. http://myportal/services/SAML)
      samlArtifact - Base-64 encoded string representing the SAML. This artifact string is generated an IArtifactFactory.
      Returns:
      Response object returned by the SAML server.
    • getLoginName

      public static String getLoginName(org.opensaml.saml1.core.Assertion samlAssertion) throws Exception
      Throws:
      Exception
    • displayAssertion

      public static void displayAssertion(PrintWriter outWriter, org.opensaml.saml1.core.Assertion samlAssertion) throws Exception
      Debug method to output a Assertion object to an output stream
      Parameters:
      outWriter - - the output stream to write to
      samlAssertion - - The Assertion object to output
      Throws:
      Exception
    • unmarshallElement

      public static org.opensaml.xml.XMLObject unmarshallElement(Element samlElement)
    • marshallSamlObject

      public static Element marshallSamlObject(org.opensaml.xml.XMLObject samlObject)