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 exclude-result-prefixes="oldconf cred">
10 <xsl:param name="idp"/>
12 <!--Force UTF-8 encoding for the output.-->
13 <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8"/>
15 <xsl:variable name="spaces" select="string(' ')"/>
17 <xsl:template match="/">
18 <xsl:apply-templates/>
21 <xsl:template match="oldconf:SPConfig">
22 <xsl:text> </xsl:text>
23 <SPConfig logger="{@logger}" clockSkew="{@clockSkew}">
24 <xsl:text> </xsl:text>
26 <xsl:text> Generated by upgrade utility: check carefully before deploying. </xsl:text>
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 <xsl:text> </xsl:text>
40 <StorageService type="Memory" id="mem" cleanupInterval="900"/>
41 <xsl:text> </xsl:text>
42 <SessionCache type="StorageService" StorageService="mem" cacheTimeout="{oldconf:Global/oldconf:MemorySessionCache/@cacheTimeout}" inprocTimeout="900" cleanupInterval="900"/>
43 <xsl:text> </xsl:text>
44 <ReplayCache StorageService="mem"/>
45 <xsl:text> </xsl:text>
46 <ArtifactMap artifactTTL="180"/>
47 <xsl:text> </xsl:text>
49 <xsl:text> This set of components stores sessions and other persistent data in an ODBC database. </xsl:text>
51 <xsl:text> </xsl:text>
54 <StorageService type="ODBC" id="db" cleanupInterval="900">
55 <ConnectionString>DRIVER=drivername;SERVER=dbserver;UID=shibboleth;PWD=password;DATABASE=shibboleth;APP=Shibboleth</ConnectionString>
56 </StorageService>
57 <SessionCache type="StorageService" StorageService="db" cacheTimeout="3600" inprocTimeout="900" cleanupInterval="900"/>
58 <ReplayCache StorageService="db"/>
59 <ArtifactMap StorageService="db" artifactTTL="180"/>
62 <xsl:apply-templates select="oldconf:Local/oldconf:RequestMapProvider"/>
63 <xsl:apply-templates select="oldconf:Applications"/>
65 <xsl:text> </xsl:text>
67 <xsl:text> Each policy defines a set of rules to use to secure messages. </xsl:text>
69 <xsl:text> </xsl:text>
71 <xsl:text> </xsl:text>
73 <xsl:text> The predefined policy enforces replay/freshness and permits signing and client TLS. </xsl:text>
75 <xsl:text> </xsl:text>
76 <Policy id="default" validate="false">
77 <xsl:text> </xsl:text>
78 <Rule type="MessageFlow" checkReplay="true" expires="60"/>
79 <xsl:text> </xsl:text>
80 <Rule type="ClientCertAuth" errorFatal="true"/>
81 <xsl:text> </xsl:text>
82 <Rule type="XMLSigning" errorFatal="true"/>
83 <xsl:text> </xsl:text>
84 <Rule type="SimpleSigning" errorFatal="true"/>
85 <xsl:text> </xsl:text>
87 <xsl:text> </xsl:text>
89 <xsl:text> </xsl:text>
93 <!-- Turn <Global> into <OutOfProcess> with the ODBC extension commented out. -->
94 <xsl:template match="oldconf:Global">
95 <xsl:text> </xsl:text>
96 <OutOfProcess logger="{@logger}">
97 <xsl:text> </xsl:text>
101 <Library path="odbc-store.so" fatal="true"/>
105 <xsl:text> </xsl:text>
107 <xsl:text> </xsl:text>
110 <!-- Turn <Local> into <InProcess> with the <ISAPI> element up a level. -->
111 <xsl:template match="oldconf:Local">
112 <xsl:text> </xsl:text>
113 <InProcess logger="{@logger}">
114 <xsl:if test="@unsetHeaderValue">
115 <xsl:attribute name="unsetHeaderValue"><xsl:value-of select="@unsetHeaderValue"/></xsl:attribute>
117 <xsl:apply-templates select="oldconf:Implementation/oldconf:ISAPI"/>
118 <xsl:text> </xsl:text>
120 <xsl:text> </xsl:text>
122 <xsl:template match="oldconf:ISAPI">
123 <xsl:text> </xsl:text>
125 <xsl:apply-templates select="@*"/>
126 <xsl:for-each select="oldconf:Site">
127 <xsl:text> </xsl:text>
129 <xsl:apply-templates select="@*"/>
130 <xsl:for-each select="oldconf:Alias">
131 <xsl:text> </xsl:text>
132 <Alias><xsl:value-of select="text()"/></Alias>
134 <xsl:text> </xsl:text>
137 <xsl:text> </xsl:text>
141 <!-- Pull in listeners up to the top level. -->
142 <xsl:template match="oldconf:UnixListener">
143 <xsl:text> </xsl:text>
144 <UnixListener address="shibd.sock"/>
145 <xsl:text> </xsl:text>
147 <xsl:template match="oldconf:TCPListener">
148 <xsl:text> </xsl:text>
149 <TCPListener address="{@address}" port="{@port}" acl="{@acl}"/>
150 <xsl:text> </xsl:text>
153 <!-- Transplant old RequestMap into the new namespace, but just copy all the settings. -->
154 <xsl:template match="oldconf:RequestMapProvider">
155 <xsl:text> </xsl:text>
156 <RequestMapper type="Native">
157 <xsl:text> </xsl:text>
158 <xsl:apply-templates select="./*">
159 <xsl:with-param name="indent">8</xsl:with-param>
160 </xsl:apply-templates>
161 <xsl:text> </xsl:text>
163 <xsl:text> </xsl:text>
166 <xsl:template match="oldconf:Applications">
167 <xsl:text> </xsl:text>
168 <ApplicationDefaults id="{@id}" policyId="default" entityID="{@providerId}" homeURL="{@homeURL}" REMOTE_USER="eppn persistent-id targeted-id" signing="false" encryption="false">
169 <xsl:attribute name="timeout"><xsl:value-of select="../oldconf:Global/oldconf:MemorySessionCache/@AATimeout"/></xsl:attribute>
170 <xsl:attribute name="connectTimeout"><xsl:value-of select="../oldconf:Global/oldconf:MemorySessionCache/@AAConnectTimeout"/></xsl:attribute>
171 <xsl:if test="oldconf:CredentialUse/@TLS!=../oldconf:CredentialsProvider/cred:Credentials/cred:FileResolver[1]/@Id">
172 <xsl:attribute name="keyName"><xsl:value-of select="oldconf:CredentialUse/@TLS"/></xsl:attribute>
174 <xsl:if test="oldconf:CredentialUse/@signedAssertions">
175 <xsl:attribute name="requireSignedAssertions"><xsl:value-of select="oldconf:CredentialUse/@signedAssertions"/></xsl:attribute>
177 <xsl:text> </xsl:text>
178 <xsl:apply-templates select="oldconf:Sessions"/>
179 <xsl:apply-templates select="oldconf:Errors"/>
180 <xsl:apply-templates select="oldconf:CredentialUse"/>
181 <xsl:text> </xsl:text>
182 <MetadataProvider type="Chaining">
183 <xsl:for-each select="oldconf:MetadataProvider|oldconf:FederationProvider">
184 <xsl:text> </xsl:text>
185 <MetadataProvider type="XML" file="{@uri}"/>
187 <xsl:text> </xsl:text>
189 <xsl:text> </xsl:text>
191 <xsl:text> Chain the two built-in trust engines together. </xsl:text>
193 <xsl:text> </xsl:text>
194 <TrustEngine type="Chaining">
195 <xsl:text> </xsl:text>
196 <TrustEngine type="ExplicitKey"/>
197 <xsl:text> </xsl:text>
198 <TrustEngine type="PKIX"/>
199 <xsl:text> </xsl:text>
201 <xsl:text> </xsl:text>
203 <xsl:text> Map to extract attributes from SAML assertions. </xsl:text>
205 <xsl:text> </xsl:text>
206 <AttributeExtractor type="XML" path="attribute-map.xml"/>
207 <xsl:text> </xsl:text>
209 <xsl:text> Use a SAML query if no attributes are supplied during SSO. </xsl:text>
211 <xsl:text> </xsl:text>
212 <AttributeResolver type="Query"/>
213 <xsl:text> </xsl:text>
215 <xsl:text> Default filtering policy for recognized attributes, lets other data pass. </xsl:text>
217 <xsl:text> </xsl:text>
218 <AttributeFilter type="XML" path="attribute-policy.xml"/>
219 <xsl:text> </xsl:text>
221 <!-- Step up and pull in credentials from the top level. -->
222 <xsl:apply-templates select="../oldconf:CredentialsProvider"/>
224 <xsl:for-each select="oldconf:Application">
225 <xsl:text> </xsl:text>
226 <ApplicationOverride>
227 <xsl:apply-templates select="@*"/>
228 <xsl:apply-templates select="oldconf:Sessions"/>
229 <xsl:apply-templates select="oldconf:Errors"/>
230 <xsl:apply-templates select="oldconf:CredentialUse"/>
231 <xsl:if test="count(oldconf:MetadataProvider) + count(oldconf:FederationProvider) > 0">
232 <xsl:text> </xsl:text>
233 <MetadataProvider type="Chaining">
234 <xsl:for-each select="oldconf:MetadataProvider|oldconf:FederationProvider">
235 <xsl:text> </xsl:text>
236 <MetadataProvider type="XML" file="{@uri}"/>
238 <xsl:text> </xsl:text>
241 <xsl:text> </xsl:text>
242 </ApplicationOverride>
245 <xsl:text> </xsl:text>
246 </ApplicationDefaults>
249 <xsl:template match="oldconf:Sessions">
250 <xsl:text> </xsl:text>
251 <Sessions exportLocation="http://localhost/{@handlerURL}/GetAssertion">
252 <xsl:apply-templates select="@*"/>
253 <xsl:text> </xsl:text>
256 SessionInitiators handle session requests and relay them to a Discovery page,
257 or to an IdP if possible. Automatic session setup will use the default or first
258 element (or requireSessionWith can specify a specific one to use).
261 <xsl:for-each select="oldconf:SessionInitiator">
262 <xsl:apply-templates select="."/>
264 <xsl:text> </xsl:text>
267 md:AssertionConsumerService locations handle specific SSO protocol bindings,
268 such as SAML 2.0 POST or SAML 1.1 Artifact. The isDefault and index attributes
269 are used when sessions are initiated to determine how to tell the IdP where and
270 how to return the response.
273 <xsl:text> </xsl:text>
274 <md:AssertionConsumerService Location="/SAML2/POST" index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
275 <xsl:text> </xsl:text>
276 <md:AssertionConsumerService Location="/SAML2/POST-SimpleSign" index="2" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"/>
277 <xsl:text> </xsl:text>
278 <md:AssertionConsumerService Location="/SAML2/Artifact" index="3" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
279 <xsl:text> </xsl:text>
280 <md:AssertionConsumerService Location="/SAML2/ECP" index="4" Binding="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"/>
281 <xsl:text> </xsl:text>
282 <md:AssertionConsumerService Location="/SAML/POST" index="5" Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"/>
283 <xsl:text> </xsl:text>
284 <md:AssertionConsumerService Location="/SAML/Artifact" index="6" Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"/>
285 <xsl:text> </xsl:text>
287 <!-- Turn the old local SLO location into the new LogoutInitiator location. -->
288 <xsl:variable name="LogoutLocation">
290 <xsl:when test="md:SingleLogoutService[1]">
291 <xsl:value-of select="md:SingleLogoutService[1]/@Location"/>
293 <xsl:otherwise>/Logout</xsl:otherwise>
298 <xsl:text> LogoutInitiators enable SP-initiated local or global/single logout of sessions. </xsl:text>
300 <xsl:text> </xsl:text>
301 <LogoutInitiator type="Chaining" Location="{$LogoutLocation}" relayState="cookie">
302 <xsl:text> </xsl:text>
303 <LogoutInitiator type="SAML2" template="bindingTemplate.html"/>
304 <xsl:text> </xsl:text>
305 <LogoutInitiator type="Local"/>
306 <xsl:text> </xsl:text>
308 <xsl:text> </xsl:text>
311 <xsl:text> md:SingleLogoutService locations handle single logout (SLO) protocol messages. </xsl:text>
313 <xsl:text> </xsl:text>
314 <md:SingleLogoutService Location="/SLO/SOAP" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
315 <xsl:text> </xsl:text>
316 <md:SingleLogoutService Location="/SLO/Redirect" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
317 <xsl:text> </xsl:text>
318 <md:SingleLogoutService Location="/SLO/POST" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
319 <xsl:text> </xsl:text>
320 <md:SingleLogoutService Location="/SLO/Artifact" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
321 <xsl:text> </xsl:text>
324 <xsl:text> md:ManageNameIDService locations handle NameID management (NIM) protocol messages. </xsl:text>
326 <xsl:text> </xsl:text>
327 <md:ManageNameIDService Location="/NIM/SOAP" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
328 <xsl:text> </xsl:text>
329 <md:ManageNameIDService Location="/NIM/Redirect" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
330 <xsl:text> </xsl:text>
331 <md:ManageNameIDService Location="/NIM/POST" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
332 <xsl:text> </xsl:text>
333 <md:ManageNameIDService Location="/NIM/Artifact" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
334 <xsl:text> </xsl:text>
338 md:ArtifactResolutionService locations resolve artifacts issued when using the
339 SAML 2.0 HTTP-Artifact binding on outgoing messages, generally uses SOAP.
342 <xsl:text> </xsl:text>
343 <md:ArtifactResolutionService Location="/Artifact/SOAP" index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
344 <xsl:text> </xsl:text>
347 <xsl:text> Extension service that generates "approximate" metadata based on SP configuration. </xsl:text>
349 <xsl:text> </xsl:text>
350 <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
351 <xsl:text> </xsl:text>
354 <xsl:text> Status reporting service. </xsl:text>
356 <xsl:text> </xsl:text>
357 <Handler type="Status" Location="Status" acl="127.0.0.1"/>
358 <xsl:text> </xsl:text>
361 <xsl:text> Session diagnostic service. </xsl:text>
363 <xsl:text> </xsl:text>
364 <Handler type="Session" Location="/Session"/>
365 <xsl:text> </xsl:text>
367 <xsl:text> </xsl:text>
370 <xsl:template match="oldconf:SessionInitiator">
371 <xsl:text> </xsl:text>
372 <SessionInitiator type="Chaining" Location="{@Location}" acsByIndex="false" relayState="cookie">
374 <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
376 <xsl:if test="@isDefault">
377 <xsl:attribute name="isDefault"><xsl:value-of select="@isDefault"/></xsl:attribute>
379 <xsl:if test="@Location=../oldconf:SessionInitiator[1]/@Location">
381 <xsl:attribute name="entityID"><xsl:value-of select="$idp"/></xsl:attribute>
384 <xsl:text> </xsl:text>
385 <SessionInitiator type="SAML2" defaultACSIndex="1" ECP="true" template="bindingTemplate.html"/>
386 <xsl:text> </xsl:text>
387 <SessionInitiator type="Shib1" defaultACSIndex="4"/>
388 <xsl:if test="@wayfURL">
389 <xsl:if test="@wayfBinding='urn:mace:shibboleth:1.0:profiles:AuthnRequest'">
390 <xsl:text> </xsl:text>
391 <SessionInitiator type="WAYF" URL="{@wayfURL}"/>
394 <xsl:text> </xsl:text>
398 <!-- Map <Errors> element across, adding logout templates. -->
399 <xsl:template match="oldconf:Errors">
400 <xsl:text> </xsl:text>
402 <xsl:apply-templates select="@*"/>
403 <xsl:attribute name="localLogout">localLogout.html</xsl:attribute>
404 <xsl:attribute name="globalLogout">globalLogout.html</xsl:attribute>
405 <xsl:text> </xsl:text>
407 <xsl:text> </xsl:text>
410 <!-- Map <CredentialUse> element content into relying party overrides. -->
411 <xsl:template match="oldconf:CredentialUse">
412 <xsl:for-each select="oldconf:RelyingParty">
414 <xsl:text> </xsl:text>
415 <RelyingParty Name="{@Name}" keyName="{@TLS}"/>
420 <!-- Map legacy <FileResolver> elements to CredentialResolver plugins. -->
421 <xsl:template match="oldconf:CredentialsProvider">
423 <xsl:when test="count(//cred:FileResolver) > 1">
424 <xsl:text> </xsl:text>
425 <CredentialResolver type="Chaining">
426 <xsl:text> </xsl:text>
427 <xsl:apply-templates select="//cred:FileResolver">
428 <xsl:with-param name="indent">12</xsl:with-param>
429 </xsl:apply-templates>
430 <xsl:text> </xsl:text>
431 </CredentialResolver>
432 <xsl:text> </xsl:text>
435 <xsl:apply-templates select="//cred:FileResolver">
436 <xsl:with-param name="indent">8</xsl:with-param>
437 </xsl:apply-templates>
441 <xsl:template match="cred:FileResolver">
442 <xsl:param name="indent"/>
443 <xsl:value-of select="substring($spaces,0,$indent+1)"/>
444 <CredentialResolver type="File" key="{cred:Key/cred:Path/text()}" certificate="{cred:Certificate/cred:Path/text()}" keyName="{@Id}"/>
445 <xsl:text> </xsl:text>
448 <!-- Generic rule to pass through all element node content while converting the namespace. -->
449 <xsl:template match="oldconf:RequestMap|oldconf:Host|oldconf:HostRegex|oldconf:Path|oldconf:PathRegex|oldconf:htaccess|oldconf:AccessControl|oldconf:AND|oldconf:OR|oldconf:NOT">
450 <xsl:param name="indent"/>
451 <xsl:value-of select="substring($spaces,0,$indent+1)"/>
452 <xsl:element name="{name()}">
453 <xsl:apply-templates select="@*"/>
454 <xsl:text> </xsl:text>
455 <xsl:apply-templates select="./*">
456 <xsl:with-param name="indent" select="$indent + 4"/>
457 </xsl:apply-templates>
458 <xsl:value-of select="substring($spaces,0,$indent+1)"/>
460 <xsl:text> </xsl:text>
463 <!-- Generic rule to pass through all attributes plus text content while converting the namespace. -->
464 <xsl:template match="oldconf:Rule">
465 <xsl:param name="indent"/>
466 <xsl:value-of select="substring($spaces,0,$indent+1)"/>
467 <xsl:element name="{name()}">
468 <xsl:apply-templates select="@*"/>
469 <xsl:value-of select="text()"/>
471 <xsl:text> </xsl:text>
474 <!-- Generic rule to pass through an attribute unmodified. -->
475 <xsl:template match="@*">
476 <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
479 <!-- Strips additional text nodes out of document. -->
480 <xsl:template match="text()"/>