Skip to content

Instantly share code, notes, and snippets.

@trscavo
Last active April 18, 2023 16:40
Show Gist options
  • Save trscavo/551e257c3ea59a454e9f3c9aa87ea2bc to your computer and use it in GitHub Desktop.
Save trscavo/551e257c3ea59a454e9f3c9aa87ea2bc to your computer and use it in GitHub Desktop.
Extract an entity descriptor from a SAML metadata aggregate
<?xml version="1.0" encoding="UTF-8"?>
<!--
extract_entity.xsl
An XSL transform that takes a SAML V2.0 metadata file and
extracts a single entity descriptor.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">
<xsl:param name="entityID" required="yes"/>
<xsl:template match="/">
<xsl:copy-of select="/md:EntitiesDescriptor/md:EntityDescriptor[@entityID=$entityID]"/>
</xsl:template>
</xsl:stylesheet>
@mmoayyed
Copy link

Thank you. This is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment