Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!--
list_entity_roles_txt.xsl
This XSL transform takes a SAML metadata document and produces
a tab-separated list of triples:
(@entityID, roleDescriptor, @registrationAuthority)
where roleDescriptor is one of the following:
@trscavo
trscavo / list_all_entity_endpoints_txt.xsl
Last active November 12, 2017 23:12
Flatten entity endpoints in a SAML metadata aggregate
<?xml version="1.0" encoding="UTF-8"?>
<!--
list_all_entity_endpoints_txt.xsl
This XSL transform takes a SAML V2.0 metadata file as input.
The script matches on every md:EntityDescriptor element in the
input. It then flattens all endpoints in metadata by returning lines
of output consisting of the following space-separated fields:
roleDescriptor endpointType binding location entityID registrarID
@trscavo
trscavo / list_all_org_SPs_csv.xsl
Created January 6, 2017 20:51
Extract all entities with an SP role and a particular orgName into a CSV file
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017 Internet2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@trscavo
trscavo / count_entity_roles.xsl
Created October 9, 2016 14:24
Count the SAML entities in a SAML V2.0 metadata file
<?xml version="1.0" encoding="UTF-8"?>
<!--
count_entity_roles.xsl
An XSL transform that takes a SAML V2.0 metadata file and
counts entities with various roles and characteristics.
Usage:
$ MD_PATH=/path/to/saml/metadata.xml
$ LIB_DIR=/path/to/source/lib/dir
@trscavo
trscavo / extract_entity.xsl
Last active April 18, 2023 16:40
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">
@trscavo
trscavo / extract_entity_attributes.xsl
Last active January 19, 2017 14:00
An XSL transform that takes a SAML V2.0 metadata file and produces a list of all entity attributes in plain text.
<?xml version="1.0" encoding="UTF-8"?>
<!--
extract_entity_attributes.xsl
An XSL transform that takes a SAML V2.0 metadata file and
produces a list of all entity attributes in plain text.
Usage:
$ MD_PATH=/path/to/saml/metadata.xml
$ SOURCE_LIB=/path/to/source/lib/dir
@trscavo
trscavo / md_tools.sh
Created January 10, 2016 18:34
SAML metadata helper tools for bash scripts
#!/bin/bash
#######################################################################
# Copyright 2016 InCommon, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@trscavo
trscavo / extract_non-InCommon_IdP_entityIDs.xsl
Created January 6, 2016 14:20
An XSL stylesheet that takes a SAML 2.0 metadata file and extracts the non-InCommon IdP entityIDs as plain text.
<?xml version="1.0" encoding="UTF-8"?>
<!--
extract_non-InCommon_IdP_entityIDs.xsl
XSL stylesheet that takes a SAML 2.0 metadata file and extracts the
non-InCommon IdP entityIDs as plain text. An entity is not an InCommon
IdP if its registar ID is something other than the InCommon registrar
ID "https://incommon.org".
-->
<xsl:stylesheet version="1.0"
@trscavo
trscavo / extract_InCommon_IdP_entityIDs.xsl
Created January 5, 2016 14:02
An XSL stylesheet that takes a SAML 2.0 metadata file and extracts the InCommon IdP entityIDs as plain text.
<?xml version="1.0" encoding="UTF-8"?>
<!--
extract_InCommon_IdP_entityIDs.xsl
XSL stylesheet that takes a SAML 2.0 metadata file and extracts the
InCommon IdP entityIDs as plain text. The script recognizes an InCommon
entity by the presence of the InCommon registrar ID "https://incommon.org".
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
@trscavo
trscavo / probe_shib_idps.sh
Last active January 10, 2016 18:54
A bash script that probes a sequence of Shibboleth IdPs to determine which are based on the Shibboleth IdP V2 software
#!/bin/bash
#######################################################################
# Copyright 2015--2016 InCommon, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0