Add schema validation to metadata examples
[shibboleth/cpp-sp.git] / configs / example-shibboleth2.xml
1 <SPConfig xmlns="urn:mace:shibboleth:2.0:native:sp:config"
2     xmlns:conf="urn:mace:shibboleth:2.0:native:sp:config"
3     xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
4     xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"    
5     xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
6     logger="syslog.logger" clockSkew="180">
7
8     <!-- The OutOfProcess section contains properties affecting the shibd daemon. -->
9     <OutOfProcess logger="shibd.logger">
10         <!--
11         <Extensions>
12             <Library path="odbc-store.so" fatal="true"/>
13         </Extensions>
14         -->
15     </OutOfProcess>
16
17     <!--
18     The InProcess section contains settings affecting web server modules.
19     Required for IIS, but can be removed when using other web servers.
20     -->
21     <InProcess logger="native.logger">
22         <ISAPI normalizeRequest="true" safeHeaderNames="true">
23             <!--
24             Maps IIS Instance ID values to the host scheme/name/port. The name is
25             required so that the proper <Host> in the request map above is found without
26             having to cover every possible DNS/IP combination the user might enter.
27             -->
28             <Site id="1" name="sp.example.org"/>
29             <!--
30             When the port and scheme are omitted, the HTTP request's port and scheme are used.
31             If these are wrong because of virtualization, they can be explicitly set here to
32             ensure proper redirect generation.
33             -->
34             <!--
35             <Site id="42" name="virtual.example.org" scheme="https" port="443"/>
36             -->
37         </ISAPI>
38     </InProcess>
39     
40     <!-- Only one listener can be defined, to connect in-process modules to shibd. -->
41     <UnixListener address="shibd.sock"/>
42     <!-- <TCPListener address="127.0.0.1" port="1600" acl="127.0.0.1"/> -->
43     
44     <!-- This set of components stores sessions and other persistent data in daemon memory. -->
45     <StorageService type="Memory" id="mem" cleanupInterval="900"/>
46     <SessionCache type="StorageService" StorageService="mem" cacheAssertions="false"
47                   cacheAllowance="900" inprocTimeout="900" cleanupInterval="900"/>
48     <ReplayCache StorageService="mem"/>
49     <ArtifactMap artifactTTL="180"/>
50
51     <!-- This set of components stores sessions and other persistent data in an ODBC database. -->
52     <!--
53     <StorageService type="ODBC" id="db" cleanupInterval="900">
54         <ConnectionString>
55         DRIVER=drivername;SERVER=dbserver;UID=shibboleth;PWD=password;DATABASE=shibboleth;APP=Shibboleth
56         </ConnectionString>
57     </StorageService>
58     <SessionCache type="StorageService" StorageService="db" cacheAssertions="false"
59                   cacheTimeout="3600" inprocTimeout="900" cleanupInterval="900"/>
60     <ReplayCache StorageService="db"/>
61     <ArtifactMap StorageService="db" artifactTTL="180"/>
62     -->
63
64     <!--
65     To customize behavior for specific resources on Apache, and to link vhosts or
66     resources to ApplicationOverride settings below, use web server options/commands.
67     See https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPConfigurationElements for help.
68     
69     For examples with the RequestMap XML syntax instead, see the example-shibboleth2.xml
70     file, and the https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPRequestMapHowTo topic.
71     -->
72     <RequestMapper type="Native">
73         <RequestMap>
74             <!--
75             The example requires a session for documents in /secure on the containing host with http and
76             https on the default ports. Note that the name and port in the <Host> elements MUST match
77             Apache's ServerName and Port directives or the IIS Site name in the <ISAPI> element above.
78             -->
79             <Host name="sp.example.org">
80                 <Path name="secure" authType="shibboleth" requireSession="true"/>
81             </Host>
82             <!-- Example of a second vhost mapped to a different applicationId. -->
83             <!--
84             <Host name="admin.example.org" applicationId="admin" authType="shibboleth" requireSession="true"/>
85             -->
86         </RequestMap>
87     </RequestMapper>
88
89     <!--
90     The ApplicationDefaults element is where most of Shibboleth's SAML bits are defined.
91     Resource requests are mapped by the RequestMapper to an applicationId that
92     points into to this section (or to the defaults here).
93     -->
94     <ApplicationDefaults entityID="https://sp.example.org/shibboleth"
95                          REMOTE_USER="eppn persistent-id targeted-id"
96                          metadataAttributePrefix="Meta-"
97                          sessionHook="/Shibboleth.sso/AttrChecker"
98                          signing="false" encryption="false">
99
100         <!--
101         Controls session lifetimes, address checks, cookie handling, and the protocol handlers.
102         You MUST supply an effectively unique handlerURL value for each of your applications.
103         The value defaults to /Shibboleth.sso, and should be a relative path, with the SP computing
104         a relative value based on the virtual host. Using handlerSSL="true", the default, will force
105         the protocol to be https. You should also set cookieProps to "https" for SSL-only sites.
106         Note that while we default checkAddress to "false", this has a negative impact on the
107         security of your site. Stealing sessions via cookie theft is much easier with this disabled.
108         -->
109         <Sessions lifetime="28800" timeout="3600" checkAddress="false"
110             handlerURL="/Shibboleth.sso" handlerSSL="false" cookieProps="http" relayState="ss:mem"
111             exportLocation="http://localhost/Shibboleth.sso/GetAssertion" exportACL="127.0.0.1"
112             idpHistory="false" idpHistoryDays="7">
113
114             <!--
115             The "stripped down" files use the shorthand syntax for configuring handlers.
116             This uses the old "every handler specified directly" syntax. You can replace
117             or supplement the new syntax following these examples.
118             -->
119           
120             <!--
121             SessionInitiators handle session requests and relay them to a Discovery page,
122             or to an IdP if possible. Automatic session setup will use the default or first
123             element (or requireSessionWith can specify a specific id to use).
124             -->
125
126             <!-- Default directs to a specific IdP (favoring SAML 2 over Shib 1). -->
127             <SessionInitiator type="Chaining" Location="/Login" isDefault="true" id="Login"
128                               entityID="https://idp.example.org/idp/shibboleth">
129               
130                 <SessionInitiator type="SAML2" template="bindingTemplate.html"/>
131                 <SessionInitiator type="Shib1"/>
132                 <!--
133                 To allow for >1 IdP, remove entityID property from Chaining element and add
134                 *either* of the SAMLDS or WAYF handlers below:
135                 
136                 <SessionInitiator type="SAMLDS" URL="https://ds.example.org/DS/WAYF"/>
137                 <SessionInitiator type="WAYF" URL="https://wayf.example.org/WAYF"/>
138                 -->
139             </SessionInitiator>
140             
141             <!--
142             md:AssertionConsumerService locations handle specific SSO protocol bindings,
143             such as SAML 2.0 POST or SAML 1.1 Artifact. The isDefault and index attributes
144             are used when sessions are initiated to determine how to tell the IdP where and
145             how to return the response.
146             -->
147             <md:AssertionConsumerService Location="/SAML2/POST" index="1"
148                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
149             <md:AssertionConsumerService Location="/SAML2/POST-SimpleSign" index="2"
150                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"/>
151             <md:AssertionConsumerService Location="/SAML2/Artifact" index="3"
152                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
153             <md:AssertionConsumerService Location="/SAML2/ECP" index="4"
154                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"/>
155             <md:AssertionConsumerService Location="/SAML/POST" index="5"
156                 Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"/>
157             <md:AssertionConsumerService Location="/SAML/Artifact" index="6"
158                 Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"/>
159
160             <!-- LogoutInitiators enable SP-initiated local or global/single logout of sessions. -->
161             <LogoutInitiator type="Chaining" Location="/Logout">
162                 <LogoutInitiator type="SAML2" template="bindingTemplate.html"/>
163                 <LogoutInitiator type="Local"/>
164             </LogoutInitiator>
165
166             <!-- md:SingleLogoutService locations handle single logout (SLO) protocol messages. -->
167             <md:SingleLogoutService Location="/SLO/SOAP"
168                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
169             <md:SingleLogoutService Location="/SLO/Redirect" conf:template="bindingTemplate.html"
170                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
171             <md:SingleLogoutService Location="/SLO/POST" conf:template="bindingTemplate.html"
172                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
173             <md:SingleLogoutService Location="/SLO/Artifact" conf:template="bindingTemplate.html"
174                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
175
176             <!-- md:ManageNameIDService locations handle NameID management (NIM) protocol messages. -->
177             <md:ManageNameIDService Location="/NIM/SOAP"
178                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
179             <md:ManageNameIDService Location="/NIM/Redirect" conf:template="bindingTemplate.html"
180                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
181             <md:ManageNameIDService Location="/NIM/POST" conf:template="bindingTemplate.html"
182                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
183             <md:ManageNameIDService Location="/NIM/Artifact" conf:template="bindingTemplate.html"
184                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
185
186             <!--
187             md:ArtifactResolutionService locations resolve artifacts issued when using the
188             SAML 2.0 HTTP-Artifact binding on outgoing messages, generally uses SOAP.
189             -->
190             <md:ArtifactResolutionService Location="/Artifact/SOAP" index="1"
191                 Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
192
193             <!-- Extension service that generates "approximate" metadata based on SP configuration. -->
194             <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
195
196             <!-- Status reporting service. -->
197             <Handler type="Status" Location="/Status" acl="127.0.0.1 ::1"/>
198
199             <!-- Session diagnostic service. -->
200             <Handler type="Session" Location="/Session" showAttributeValues="false"/>
201
202             <!-- JSON feed of discovery information. -->
203             <Handler type="DiscoveryFeed" Location="/DiscoFeed"/>
204
205             <!-- Checks for required attribute(s) before login completes. -->
206             <Handler type="AttributeChecker" Location="/AttrChecker" template="attrChecker.html"
207                 attributes="eppn" flushSession="true"/>
208         </Sessions>
209
210         <!--
211         Allows overriding of error template information/filenames. You can
212         also add attributes with values that can be plugged into the templates.
213         -->
214         <Errors supportContact="root@localhost"
215             helpLocation="/about.html"
216             styleSheet="/shibboleth-sp/main.css"/>
217         
218         <!--
219         Uncomment and modify to tweak settings for specific IdPs or groups. Settings here
220         generally match those allowed by the <ApplicationDefaults> element.
221         -->
222         <!--
223         <RelyingParty Name="SpecialFederation" keyName="SpecialKey"/>
224         -->
225
226         <!-- Example of remotely supplied batch of signed metadata. -->
227         <!--
228         <MetadataProvider type="XML" validate="true"
229               uri="http://federation.org/federation-metadata.xml"
230               backingFilePath="federation-metadata.xml" reloadInterval="7200">
231             <MetadataFilter type="RequireValidUntil" maxValidityInterval="2419200"/>
232             <MetadataFilter type="Signature" certificate="fedsigner.pem"/>
233             <DiscoveryFilter type="Blacklist" matcher="EntityAttributes" trimTags="true" 
234               attributeName="http://macedir.org/entity-category"
235               attributeNameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
236               attributeValue="http://refeds.org/category/hide-from-discovery" />
237           </MetadataProvider>
238         -->
239
240         <!-- Example of locally maintained metadata. -->
241         <!--
242         <MetadataProvider type="XML" validate="true" file="partner-metadata.xml"/>
243         -->
244
245         <!-- TrustEngines run in order to evaluate peer keys and certificates. -->
246         <TrustEngine type="ExplicitKey"/>
247         <TrustEngine type="PKIX"/>
248
249         <!-- Map to extract attributes from SAML assertions. -->
250         <AttributeExtractor type="XML" validate="true" reloadChanges="false" path="attribute-map.xml"/>
251
252         <!-- Extracts support information for IdP from its metadata. -->
253         <AttributeExtractor type="Metadata" errorURL="errorURL" DisplayName="displayName"/>
254
255         <!-- Use a SAML query if no attributes are supplied during SSO. -->
256         <AttributeResolver type="Query" subjectMatch="true"/>
257
258         <!-- Default filtering policy for recognized attributes, lets other data pass. -->
259         <AttributeFilter type="XML" validate="true" path="attribute-policy.xml"/>
260
261         <!-- Simple file-based resolver for using a single keypair. -->
262         <CredentialResolver type="File" key="sp-key.pem" certificate="sp-cert.pem"/>
263
264         <!--
265         The default settings can be overridden by creating ApplicationOverride elements (see
266         the https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPApplicationOverride topic).
267         Resource requests are mapped by web server commands, or the RequestMapper, to an
268         applicationId setting.
269         
270         Example of a second application (for a second vhost) that has a different entityID.
271         Resources on the vhost would map to an applicationId of "admin":
272         -->
273         <!--
274         <ApplicationOverride id="admin" entityID="https://admin.example.org/shibboleth"/>
275         -->
276     </ApplicationDefaults>
277     
278     <!-- Policies that determine how to process and authenticate runtime messages. -->
279     <SecurityPolicyProvider type="XML" validate="true" path="security-policy.xml"/>
280
281     <!-- Low-level configuration about protocols and bindings available for use. -->
282     <ProtocolProvider type="XML" validate="true" reloadChanges="false" path="protocols.xml"/>
283
284 </SPConfig>