Class IdPMetadataParser

java.lang.Object
org.codelibs.saml2.core.settings.IdPMetadataParser

public class IdPMetadataParser extends Object
IdPMetadataParser class of Java Toolkit. A class that implements the settings parser from IdP Metadata This class does not validate in any way the URL that is introduced, make sure to validate it properly before use it in a get_metadata method.
  • Constructor Details

    • IdPMetadataParser

      public IdPMetadataParser()
  • Method Details

    • parseXML

      public static Map<String,Object> parseXML(Document xmlDocument, String entityId, String desiredNameIdFormat, String desiredSSOBinding, String desiredSLOBinding)
      Get IdP Metadata Info from XML Document
      Parameters:
      xmlDocument - XML document hat contains IdP metadata
      entityId - Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned
      desiredNameIdFormat - If available on IdP metadata, use that nameIdFormat
      desiredSSOBinding - Parse specific binding SSO endpoint.
      desiredSLOBinding - Parse specific binding SLO endpoint.
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseXML

      public static Map<String,Object> parseXML(Document xmlDocument, String entityId)
      Get IdP Metadata Info from XML Document
      Parameters:
      xmlDocument - XML document that contains IdP metadata
      entityId - Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseXML

      public static Map<String,Object> parseXML(Document xmlDocument)
      Get IdP Metadata Info from XML Document
      Parameters:
      xmlDocument - XML document that contains IdP metadata
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseFileXML

      public static Map<String,Object> parseFileXML(String xmlFileName, String entityId, String desiredNameIdFormat, String desiredSSOBinding, String desiredSLOBinding)
      Get IdP Metadata Info from XML file
      Parameters:
      xmlFileName - Filename of the XML filename that contains IdP metadata
      entityId - Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned
      desiredNameIdFormat - If available on IdP metadata, use that nameIdFormat
      desiredSSOBinding - Parse specific binding SSO endpoint.
      desiredSLOBinding - Parse specific binding SLO endpoint.
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseFileXML

      public static Map<String,Object> parseFileXML(String xmlFileName, String entityId)
      Get IdP Metadata Info from XML file
      Parameters:
      xmlFileName - Filename of the XML filename that contains IdP metadata
      entityId - Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseFileXML

      public static Map<String,Object> parseFileXML(String xmlFileName)
      Get IdP Metadata Info from XML file
      Parameters:
      xmlFileName - Filename of the XML filename that contains IdP metadata
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseRemoteXML

      public static Map<String,Object> parseRemoteXML(URL xmlURL, String entityId, String desiredNameIdFormat, String desiredSSOBinding, String desiredSLOBinding)
      Get IdP Metadata Info from XML file
      Parameters:
      xmlURL - URL to the XML document that contains IdP metadata
      entityId - Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned
      desiredNameIdFormat - If available on IdP metadata, use that nameIdFormat
      desiredSSOBinding - Parse specific binding SSO endpoint.
      desiredSLOBinding - Parse specific binding SLO endpoint.
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseRemoteXML

      public static Map<String,Object> parseRemoteXML(URL xmlURL, String entityId)
      Get IdP Metadata Info from XML file
      Parameters:
      xmlURL - URL to the XML document that contains IdP metadata
      entityId - Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • parseRemoteXML

      public static Map<String,Object> parseRemoteXML(URL xmlURL)
      Get IdP Metadata Info from XML file
      Parameters:
      xmlURL - URL to the XML document that contains IdP metadata
      Returns:
      Mapped values with metadata info in Saml2Settings format
    • injectIntoSettings

      public static Saml2Settings injectIntoSettings(Saml2Settings settings, Map<String,Object> metadataInfo)
      Inject metadata info into Saml2Settings
      Parameters:
      settings - the Saml2Settings object
      metadataInfo - mapped values with metadata info in Saml2Settings format
      Returns:
      the Saml2Settings object with metadata info settings loaded