The Shibboleth V1 software has reached its End of Life and is no longer supported. This documentation is available for historical purposes only.

EmbeddedCertificates

Embedding Certificates in Metadata

Trust between Shibboleth providers can be achieved by embedding certificates used by the providers directly in their metadata. This has a number of advantages over a PKI-based approach, such as simpler encryption flows, easier revocation, and more flexibility for certificate issuance. Any certificate will work, and this approach can be used, but self-signed certificates are easiest to make if you don't already have one lying around.

To create a keypair and a self-signed certificate, use the following two commands. Complete all the fields as seems appropriate; the only important one is the CN field, which must be equal to the full domain name of the server, such as www.supervillain.edu .

openssl genrsa -out myprovider.key 2048
openssl req -new -x509 -nodes -sha1 -days 3650 -key myprovider.key > myprovider.crt

Cat out the new certificate file's contents. Strip out the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- strings, but leave them in the file itself. Leading and trailing whitespace breaks early Xerces, and was fixed in 2.6.1 and in 2.7. Embedded whitespace (indenting) probably requires xmlsec 1.3, which doesn't use openssl's broken base64 decoder; it's not clear what the Java parser allows. Place the resulting alphanumeric soup in XML like the following:

<KeyDescriptor>
	<ds:KeyInfo>
		<ds:X509Data>
			<ds:X509Certificate>
MIIExzCCA6+gAwIBAgIJAM+MlFr0Sth6MA0GCSqGSIb3DQEBBQUAMIGdMR8wHQYD
VQQDExZTdXBlcnZpbGxhaW46IFRoZSBSb290MQswCQYDVQQGEwJVUzERMA8GA1UE
CBMITmV3IFlvcmsxDzANBgNVBAcTBkdvdGhhbTEgMB4GA1UEChMXU3VwZXJ2aWxs
YWluIFVuaXZlcnNpdHkxJzAlBgkqhkiG9w0BCQEWGHBlbmd1aW5Ac3VwZXJ2aWxs
YWluLmVkdTAeFw0wNjA4MTcxOTU5NTNaFw0xMTA4MTYxOTU5NTNaMIGdMR8wHQYD
VQQDExZTdXBlcnZpbGxhaW46IFRoZSBSb290MQswCQYDVQQGEwJVUzERMA8GA1UE
CBMITmV3IFlvcmsxDzANBgNVBAcTBkdvdGhhbTEgMB4GA1UEChMXU3VwZXJ2aWxs
YWluIFVuaXZlcnNpdHkxJz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UixPlH9CrmeSCP2S
sfbiKnMOGXjIYbvbsTAMdW2iqg6IWa/fgxhvZoAXChM9bkhisJQc0qD0J5TJQwgr
uEyb50RJ7DWmXctSC0b3eymZ2lSXxAWNOsNy
			</ds:X509Certificate>
		</ds:X509Data>
	</ds:KeyInfo>
</KeyDescriptor>

The complete metadata for a two-provider Evil Federation would thus resemble:

<EntitiesDescriptor
	 xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
	 xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
	 xsi:schemaLocation="urn:oasis:names:tc:SAML:2.0:metadata ../schemas/saml-schema-metadata-2.0.xsd
	 urn:mace:shibboleth:metadata:1.0 ../schemas/shibboleth-metadata-1.0.xsd
	 http://www.w3.org/2000/09/xmldsig# ../schemas/xmldsig-core-schema.xsd"
	 Name="https://www.supervillain.edu/evil-federation/policy.html"
	 validUntil="2010-01-01T00:00:00Z">

	<!-- This is the metadata for Evil Federation using embedded certificates. -->

	<!-- The Supervillain IdP -->
	<EntityDescriptor entityID="https://idp.example.org/shibboleth">
		<IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol urn:mace:shibboleth:1.0">
			<Extensions>
				<!-- It's authoritative for supervillain.edu. -->
				<shibmd:Scope>supervillain.edu</shibmd:Scope>
			</Extensions>

			<KeyDescriptor use="signing">
				 <ds:KeyInfo>
					  <ds:X509Data>
						  <ds:X509Certificate>
MIIEzTCCA7WgAwIBAgIJAPBxTwLnvO0aMA0GCSqGSIb3DQEBBQUAMIGfMQswCQYD
VQQGEwJVUzERMA8GA1UECBMITmV3IFlvcmsxDzANBgNVBAcTBkdvdGhhbTEgMB4G
A1UEChMXU3VwZXJ2aWxsYWluIFVuaXZlcnNpdHkxHTAbBgNVBAMTFGlkcC5zdXBl
cnZpbGxhaW4uZWR1MSswKQYJKoZIhvcNAQkBFh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H/MA0G
CSqGSIb3DQEBBQUAA4IBAQCqrOghCppgxhs4a96r+LgNeUlWc6j6/t0MJA8i3HpB
B3QIvfGS/0UWUwClhx4K5clnNKmLNcps6QvwVxKE/hjzE6B9Vo4+F+0WprPjvoK5
FCYGYLfhCSDRi8GXATVQlQ6kaChOH7PgjAejrBNoRCKzq/sAP+1ZB0TaJaigbXEu
QnFlpBv54Vq+HBsS5i0N9Qd5kyB2FVOfecSzQEqOeNENreoKxlj8vLqQRH0DPObf
A2hidRUUxZktslTpuN+9hTpeqVWVx802QpzDNTeBEn8lf2e4eStQuY8edkh9yE/j
F/xPvs1EdxIeiFvd237Ef9TV2JoxEN2+pOSTtdJ8Exk0
						  </ds:X509Certificate>
					  </ds:X509Data>
				 </ds:KeyInfo>
			</KeyDescriptor>

			<ArtifactResolutionService index="1"
				Binding="urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
				Location="http://idp.example.org:8080/shibboleth-idp/Artifact"/>

			<NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>

			<SingleSignOnService Binding="urn:mace:shibboleth:1.0:profiles:AuthnRequest"
				 Location="https://idp.example.org/shibboleth-idp/SSO"/>

		</IDPSSODescriptor>
		
		<AttributeAuthorityDescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol">
			<Extensions>
				<!-- It's authoritative for supervillain.edu. -->
				<shibmd:Scope>supervillain.edu</shibmd:Scope>
			</Extensions>

			<KeyDescriptor use="signing">
				 <ds:KeyInfo>
					  <ds:X509Data>
						  <ds:X509Certificate>
MIIEzTCCA7WgAwIBAgIJAPBxTwLnvO0aMA0GCSqGSIb3DQEBBQUAMIGfMQswCQYD
VQQGEwJVUzERMA8GA1UECBMITmV3IFlvcmsxDzANBgNVBAcTBkdvdGhhbTEgMB4G
A1UEChMXU3VwZXJ2aWxsYWluIFVuaXZlcnNpdHkxHTAbBgNVBAMTFGlkcC5zdXBl
cnZpbGxhaW4uZWR1MSswKQYJKoZI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VHRMEBTADAQH/MA0G
CSqGSIb3DQEBBQUAA4IBAQCqrOghCppgxhs4a96r+LgNeUlWc6j6/t0MJA8i3HpB
B3QIvfGS/0UWUwClhx4K5clnNKmLNcps6QvwVxKE/hjzE6B9Vo4+F+0WprPjvoK5
FCYGYLfhCSDRi8GXATVQlQ6kaChOH7PgjAejrBNoRCKzq/sAP+1ZB0TaJaigbXEu
QnFlpBv54Vq+HBsS5i0N9Qd5kyB2FVOfecSzQEqOeNENreoKxlj8vLqQRH0DPObf
A2hidRUUxZktslTpuN+9hTpeqVWVx802QpzDNTeBEn8lf2e4eStQuY8edkh9yE/j
F/xPvs1EdxIeiFvd237Ef9TV2JoxEN2+pOSTtdJ8Exk0
						  </ds:X509Certificate>
					  </ds:X509Data>
				 </ds:KeyInfo>
			</KeyDescriptor>
			
			<AttributeService Binding="urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
				 Location="http://idp.example.org:8080/shibboleth-idp/AA"/>

			<NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>
		</AttributeAuthorityDescriptor>

		<!-- This is just information about the entity in human terms. -->
		<Organization>
			 <OrganizationName xml:lang="en">The Exalted University of Supervillains</OrganizationName>
			 <OrganizationDisplayName xml:lang="en">Supervillain University</OrganizationDisplayName>
			 <OrganizationURL xml:lang="en">http://www.supervillain.edu/</OrganizationURL>
		</Organization>
		<ContactPerson contactType="technical">
			 <SurName>Norman Osborn</SurName>
			 <EmailAddress>greengoblin@supervillain.edu</EmailAddress>
		</ContactPerson>

	</EntityDescriptor>

	<!-- The main Supervillain web server -->
	<EntityDescriptor entityID="https://www.supervillain.edu/shibboleth/evil-federation/sp">
	
		<SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol">

			<KeyDescriptor use="signing">
				 <ds:KeyInfo>
					  <ds:X509Data>
						  <ds:X509Certificate>
MIIEwTCCA6mgAwIBAgIJANXcCaTUM3BiMA0GCSqGSIb3DQEBBQUAMIGbM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J2aWxsYWluIFVuaXZlcnNpdHkxHTAbBgNVBAMTFHd3dy5z
dXBlcnZpbGxhaW4uZWR1MScwJQYJKoZIhvcNAQkBFhhtYWduZXRvQHN1cGVydmls
bGFpbi5lZHWCCQDV3Amk1DNwYjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
A4IBAQAWbSn0Bu0pin6elv6qYdraZAzxBqzRsr9DNn0Qw/0M4bbphiSTR8Sn6WXW
VlYs8WCl7dQR5njdf/RolrHpYFhYsE3/M6CMS4bOMSpP3cArf6qanzGUCvUVM17K
1c/hlHZ61FLCbLdw9UO0qoZhfc3iLQs9wq7/Vt8yqqEiK+K74Dg8W6Ex1P6wm99n
w1EP5Q/nzw4HvueBFkLYt2HCly2RFgUN95KK4iq+loMs+nVu+vRZQ1xeKlePYHxB
M2d1ESOWEp9vf0sWe8x9utqO3BhmSJKaf2Hq6kBT1UNoKJ7pxa7iqzjzxe5uqSEO
hGhEPd2UOHQ/FJAWtqWY7y3GyEs/
						  </ds:X509Certificate>
					  </ds:X509Data>
				 </ds:KeyInfo>
			</KeyDescriptor>

			<NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>

			<AssertionConsumerService index="1" isDefault="true"
				Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
				Location="https://www.supervillain.edu/Shibboleth.sso/SAML/POST"/>
			<AssertionConsumerService index="2"
				Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"
				Location="https://www.supervillain.edu/Shibboleth.sso/SAML/Artifact"/>
		</SPSSODescriptor>

		<!-- This is just information about the entity in human terms. -->
		<Organization>
			 <OrganizationName xml:lang="en">The Exalted University of Supervillains</OrganizationName>
			 <OrganizationDisplayName xml:lang="en">Supervillain University</OrganizationDisplayName>
			 <OrganizationURL xml:lang="en">http://www.supervillain.edu/</OrganizationURL>
		</Organization>
		<ContactPerson contactType="technical">
			 <SurName>Erik Magnus Lehnsherr</SurName>
			 <EmailAddress>magneto@supervillain.edu</EmailAddress>
		</ContactPerson>
		
	</EntityDescriptor>

</EntitiesDescriptor>