1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
3 xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
4 xmlns:oldconf="urn:mace:shibboleth:target:config:1.0"
5 xmlns:cred="urn:mace:shibboleth:credentials:1.0"
6 xmlns:conf="urn:mace:shibboleth:2.0:native:sp:config"
7 xmlns="urn:mace:shibboleth:2.0:native:sp:config"
8 xmlns:saml1="urn:oasis:names:tc:SAML:1.0:assertion"
9 xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
10 xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
11 exclude-result-prefixes="oldconf cred saml1">
13 <xsl:param name="idp"/>
15 <!-- Add a comment to the start of the output file. -->
16 <xsl:template match="/">
18 <xsl:text> Generated by upgrade utility: check carefully before deploying. </xsl:text>
20 <xsl:apply-templates/>
23 <!--Force UTF-8 encoding for the output.-->
24 <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>
26 <xsl:template match="oldconf:SPConfig">
27 <SPConfig logger="{@logger}" clockSkew="{@clockSkew}">
28 <xsl:text> </xsl:text>
29 <xsl:apply-templates select="oldconf:Global"/>
30 <xsl:text> </xsl:text>
31 <xsl:apply-templates select="oldconf:Local"/>
32 <xsl:text> </xsl:text>
33 <xsl:apply-templates select="oldconf:Global/oldconf:UnixListener"/>
34 <xsl:apply-templates select="oldconf:Global/oldconf:TCPListener"/>
35 <xsl:text> </xsl:text>
37 <xsl:text> This set of components stores sessions and other persistent data in daemon memory. </xsl:text>
39  <StorageService type="Memory" id="mem" cleanupInterval="900"/>
40  <SessionCache type="StorageService" StorageService="mem" cacheTimeout="{oldconf:Global/oldconf:MemorySessionCache/@cacheTimeout}" inprocTimeout="900" cleanupInterval="900"/>
41  <ReplayCache StorageService="mem"/>
42  <ArtifactMap artifactTTL="180"/>
43 <xsl:text> </xsl:text>
45 <xsl:text> This set of components stores sessions and other persistent data in an ODBC database. </xsl:text>
49  <StorageService type="ODBC" id="db" cleanupInterval="900">
50  <ConnectionString>DRIVER=drivername;SERVER=dbserver;UID=shibboleth;PWD=password;DATABASE=shibboleth;APP=Shibboleth</ConnectionString>
51  </StorageService>
52  <SessionCache type="StorageService" StorageService="db" cacheTimeout="3600" inprocTimeout="900" cleanupInterval="900"/>
53  <ReplayCache StorageService="db"/>
54  <ArtifactMap StorageService="db" artifactTTL="180"/>
57 <xsl:text> </xsl:text>
58 <xsl:apply-templates select="oldconf:Local/oldconf:RequestMapProvider"/>
59 <xsl:text> </xsl:text>
60 <xsl:apply-templates select="oldconf:Applications"/>
63 <xsl:text> Each policy defines a set of rules to use to secure messages. </xsl:text>
65  <SecurityPolicies>
67 <xsl:text> The predefined policy enforces replay/freshness and permits signing and client TLS. </xsl:text>
69  <Policy id="default" validate="false">
70  <Rule type="MessageFlow" checkReplay="true" expires="60"/>
71  <Rule type="ClientCertAuth" errorFatal="true"/>
72  <Rule type="XMLSigning" errorFatal="true"/>
73  <Rule type="SimpleSigning" errorFatal="true"/>
75  </SecurityPolicies>
79 <!-- Turn <Global> into <OutOfProcess> with the ODBC extension commented out. -->
80 <xsl:template match="oldconf:Global">
81  <OutOfProcess logger="{@logger}">
84  <Extensions>
85  <Library path="odbc-store.so" fatal="true"/>
92 <!-- Turn <Local> into <InProcess> with the <ISAPI> element up a level. -->
93 <xsl:template match="oldconf:Local">
94  <InProcess logger="{@logger}">
95 <xsl:if test="@unsetHeaderValue">
96 <xsl:attribute name="unsetHeaderValue"><xsl:value-of select="@unsetHeaderValue"/></xsl:attribute>
98 <xsl:apply-templates select="oldconf:Implementation/oldconf:ISAPI"/>
101 <xsl:template match="oldconf:ISAPI">
103 <xsl:apply-templates select="@*"/>
104 <xsl:for-each select="oldconf:Site">
106 <xsl:apply-templates select="@*"/>
107 <xsl:for-each select="oldconf:Alias">
108  <Alias><xsl:value-of select="text()"/></Alias>
115 <!-- Pull in listeners up to the top level. -->
116 <xsl:template match="oldconf:UnixListener">
117  <UnixListener address="shibd.sock"/>
119 <xsl:template match="oldconf:TCPListener">
120  <TCPListener address="{@address}" port="{@port}" acl="{@acl}"/>
123 <!-- Transplant old RequestMap into the new namespace, but just copy all the settings. -->
124 <xsl:template match="oldconf:RequestMapProvider">
125  <RequestMapper type="Native">
126 <xsl:apply-templates select="./*"/>
127  </RequestMapper>
130 <xsl:template match="oldconf:Applications">
131  <ApplicationDefaults id="{@id}" policyId="default"
132 entityID="{@providerId}" homeURL="{@homeURL}"
133 REMOTE_USER="eppn persistent-id targeted-id"
134 signing="false" encryption="false">
135 <xsl:attribute name="timeout"><xsl:value-of select="../oldconf:Global/oldconf:MemorySessionCache/@AATimeout"/></xsl:attribute>
136 <xsl:attribute name="connectTimeout"><xsl:value-of select="../oldconf:Global/oldconf:MemorySessionCache/@AAConnectTimeout"/></xsl:attribute>
137 <xsl:if test="oldconf:CredentialUse/@TLS!=../oldconf:CredentialsProvider/cred:Credentials/cred:FileResolver[1]/@Id">
138 <xsl:attribute name="keyName"><xsl:value-of select="oldconf:CredentialUse/@TLS"/></xsl:attribute>
140 <xsl:if test="oldconf:CredentialUse/@signedAssertions">
141 <xsl:attribute name="requireSignedAssertions"><xsl:value-of select="oldconf:CredentialUse/@signedAssertions"/></xsl:attribute>
143 <xsl:text> </xsl:text>
144 <xsl:apply-templates select="oldconf:Sessions"/>
145 <xsl:text> </xsl:text>
146 <xsl:apply-templates select="oldconf:Errors"/>
147 <xsl:text> </xsl:text>
148 <xsl:apply-templates select="oldconf:CredentialUse"/>
149 <xsl:text> </xsl:text>
150  <MetadataProvider type="Chaining">
151 <xsl:for-each select="oldconf:MetadataProvider|oldconf:FederationProvider">
152  <MetadataProvider type="XML" file="{@uri}"/>
154  </MetadataProvider>
157 <xsl:text> Chain the two built-in trust engines together. </xsl:text>
159  <TrustEngine type="Chaining">
160  <TrustEngine type="ExplicitKey"/>
161  <TrustEngine type="PKIX"/>
165 <xsl:text> Map to extract attributes from SAML assertions. </xsl:text>
167  <AttributeExtractor type="XML" path="attribute-map.xml"/>
170 <xsl:text> Use a SAML query if no attributes are supplied during SSO. </xsl:text>
172  <AttributeResolver type="Query"/>
175 <xsl:text> Default filtering policy for recognized attributes, lets other data pass. </xsl:text>
177  <AttributeFilter type="XML" path="attribute-policy.xml"/>
179 <xsl:text> </xsl:text>
181 <!-- Step up and pull in credentials from the top level. -->
182 <xsl:apply-templates select="../oldconf:CredentialsProvider"/>
184 <xsl:for-each select="oldconf:Application">
185  <ApplicationOverride>
186 <xsl:apply-templates select="@*"/>
187 <xsl:apply-templates select="oldconf:Sessions"/>
188 <xsl:apply-templates select="oldconf:Errors"/>
189 <xsl:apply-templates select="oldconf:CredentialUse"/>
190 <xsl:if test="count(oldconf:MetadataProvider) + count(oldconf:FederationProvider) > 0">
191  <MetadataProvider type="Chaining">
192 <xsl:for-each select="oldconf:MetadataProvider|oldconf:FederationProvider">
193  <MetadataProvider type="XML" file="{@uri}"/>
195  </MetadataProvider>
197  </ApplicationOverride>
200  </ApplicationDefaults>
203 <xsl:template match="oldconf:Sessions">
204  <Sessions exportLocation="http://localhost/{@handlerURL}/GetAssertion">
205 <xsl:apply-templates select="@*"/>
209  SessionInitiators handle session requests and relay them to a Discovery page,
210  or to an IdP if possible. Automatic session setup will use the default or first
211  element (or requireSessionWith can specify a specific one to use).
214 <xsl:for-each select="oldconf:SessionInitiator">
215 <xsl:text> </xsl:text>
216 <xsl:apply-templates select="."/>
221  md:AssertionConsumerService locations handle specific SSO protocol bindings,
222  such as SAML 2.0 POST or SAML 1.1 Artifact. The isDefault and index attributes
223  are used when sessions are initiated to determine how to tell the IdP where and
224  how to return the response.
227  <md:AssertionConsumerService Location="/SAML2/POST" index="1"
228 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
229  <md:AssertionConsumerService Location="/SAML2/POST-SimpleSign" index="2"
230 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"/>
231  <md:AssertionConsumerService Location="/SAML2/Artifact" index="3"
232 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
233  <md:AssertionConsumerService Location="/SAML2/ECP" index="4"
234 Binding="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"/>
235  <md:AssertionConsumerService Location="/SAML/POST" index="5"
236 Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"/>
237  <md:AssertionConsumerService Location="/SAML/Artifact" index="6"
238 Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"/>
240 <!-- Turn the old local SLO location into the new LogoutInitiator location. -->
241 <xsl:variable name="LogoutLocation">
243 <xsl:when test="md:SingleLogoutService[1]">
244 <xsl:value-of select="md:SingleLogoutService[1]/@Location"/>
246 <xsl:otherwise>/Logout</xsl:otherwise>
251 <xsl:text> LogoutInitiators enable SP-initiated local or global/single logout of sessions. </xsl:text>
253  <LogoutInitiator type="Chaining" Location="{$LogoutLocation}" relayState="cookie">
254  <LogoutInitiator type="SAML2" template="bindingTemplate.html"/>
255  <LogoutInitiator type="Local"/>
256  </LogoutInitiator>
259 <xsl:text> md:SingleLogoutService locations handle single logout (SLO) protocol messages. </xsl:text>
261  <md:SingleLogoutService Location="/SLO/SOAP"
262 Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
263  <md:SingleLogoutService Location="/SLO/Redirect" conf:template="bindingTemplate.html"
264 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
265  <md:SingleLogoutService Location="/SLO/POST" conf:template="bindingTemplate.html"
266 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
267  <md:SingleLogoutService Location="/SLO/Artifact" conf:template="bindingTemplate.html"
268 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
271 <xsl:text> md:ManageNameIDService locations handle NameID management (NIM) protocol messages. </xsl:text>
273  <md:ManageNameIDService Location="/NIM/SOAP"
274 Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
275  <md:ManageNameIDService Location="/NIM/Redirect" conf:template="bindingTemplate.html"
276 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
277  <md:ManageNameIDService Location="/NIM/POST" conf:template="bindingTemplate.html"
278 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
279  <md:ManageNameIDService Location="/NIM/Artifact" conf:template="bindingTemplate.html"
280 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
284  md:ArtifactResolutionService locations resolve artifacts issued when using the
285  SAML 2.0 HTTP-Artifact binding on outgoing messages, generally uses SOAP.
288  <md:ArtifactResolutionService Location="/Artifact/SOAP" index="1"
289 Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
292 <xsl:text> Extension service that generates "approximate" metadata based on SP configuration. </xsl:text>
294  <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
297 <xsl:text> Status reporting service. </xsl:text>
299  <Handler type="Status" Location="Status" acl="127.0.0.1"/>
302 <xsl:text> Session diagnostic service. </xsl:text>
304  <Handler type="Session" Location="/Session"/>
309 <xsl:template match="oldconf:SessionInitiator">
310  <SessionInitiator type="Chaining" Location="{@Location}" acsByIndex="false" relayState="cookie">
312 <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
314 <xsl:if test="@isDefault">
315 <xsl:attribute name="isDefault"><xsl:value-of select="@isDefault"/></xsl:attribute>
317 <xsl:if test="@Location=../oldconf:SessionInitiator[1]/@Location">
319 <xsl:attribute name="entityID"><xsl:value-of select="$idp"/></xsl:attribute>
322  <SessionInitiator type="SAML2" defaultACSIndex="1" ECP="true" template="bindingTemplate.html"/>
323  <SessionInitiator type="Shib1" defaultACSIndex="4"/>
324 <xsl:if test="@wayfURL">
325 <xsl:if test="@wayfBinding='urn:mace:shibboleth:1.0:profiles:AuthnRequest'">
326  <SessionInitiator type="WAYF" URL="{@wayfURL}"/>
329  </SessionInitiator>
332 <!-- Map <Errors> element across, adding logout templates. -->
333 <xsl:template match="oldconf:Errors">
335 <xsl:apply-templates select="@*"/>
336 <xsl:attribute name="localLogout">localLogout.html</xsl:attribute>
337 <xsl:attribute name="globalLogout">globalLogout.html</xsl:attribute>
341 <!-- Map <CredentialUse> element content into relying party overrides. -->
342 <xsl:template match="oldconf:CredentialUse">
343 <xsl:for-each select="oldconf:RelyingParty">
344  <RelyingParty Name="{@Name}">
346 <xsl:attribute name="keyName"><xsl:value-of select="@TLS"/></xsl:attribute>
348  </RelyingParty>
352 <!-- Map legacy <FileResolver> elements to CredentialResolver plugins. -->
353 <xsl:template match="oldconf:CredentialsProvider">
355 <xsl:when test="count(//cred:FileResolver) > 1">
356  <CredentialResolver type="Chaining">
357 <xsl:apply-templates select="//cred:FileResolver"/>
358  </CredentialResolver>
361 <xsl:apply-templates select="//cred:FileResolver"/>
365 <xsl:template match="cred:FileResolver">
366  <CredentialResolver type="File" key="{cred:Key/cred:Path/text()}" certificate="{cred:Certificate/cred:Path/text()}" keyName="{@Id}"/>
369 <!-- Generic rule to pass through all element node content while converting the namespace. -->
370 <xsl:template match="oldconf:RequestMap|oldconf:Host|oldconf:HostRegex|oldconf:Path|oldconf:PathRegex|oldconf:htaccess|oldconf:AccessControl|oldconf:AND|oldconf:OR|oldconf:NOT">
371  <xsl:element name="{name()}">
372 <xsl:apply-templates select="@*"/>
373 <xsl:apply-templates select="./*"/>
377 <!-- Generic rule to pass through all attributes plus text content while converting the namespace. -->
378 <xsl:template match="oldconf:Rule">
379  <xsl:element name="{name()}">
380 <xsl:apply-templates select="@*"/>
381 <xsl:value-of select="text()"/>
385 <!-- Generic rule to pass through an attribute unmodified. -->
386 <xsl:template match="@*">
387 <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
390 <!-- Strips additional text nodes out of document. -->
391 <xsl:template match="text()"/>