Page tree
Skip to end of metadata
Go to start of metadata

This guide describes how the Shibboleth v3 SP can be configured as a SAML Service Provider for eduTEAMS. 

Shibboleth (pronounced "Shibboleth") is the reference implementation of the OASIS SAML standard.

Installing and setting up the Shibboleth Service Provider in full is beyond the scope of this document. Many resources are available, such as the Shibboleth Wiki ( and the installation instructions supplied and maintained by SWITCH (

It is assumed in the following that you are using Shibboleth's v3 SP alongside the Apache webserver. If you are using a different webserver, the configuration of the SP should remain the same, with any differences being a requirement of your chosen web server.

1. Shibboleth configuration

Locate the file shibboleth2.xml. For example, using the instructions (see above) for an Ubuntu Linux system, you will find the file at /etc/shibboleth/shibboleth2.xml.

We show to the right, sections of the file in which you will need to enter information relevant to your installation.

Enter your [your_sp_entity_id]:


<!-- By default, in-memory StorageService, ReplayCache, ArtifactMap, and SessionCache are used. See example-shibboleth2.xml for samples of explicitly configuring them. -->
<!-- The ApplicationDefaults element is where most of Shibboleth's SAML bits are defined. -->
<ApplicationDefaults entityID="[your_sp_entity_id]"

Make sure handlerSSL="true" cookieProps="https" exist as follows:

        <Sessions lifetime="28800" timeout="3600" relayState="ss:mem"
                  checkAddress="false" handlerSSL="true" cookieProps="https">

We would also encourage you to consider redirectLimit="exact" in the above <Sessions .... > section. You might find the following useful :

Enter your [vo_entity_id]:


Configures SSO for a default IdP. To properly allow for >1 IdP, remove
entityID property and adjust discoveryURL to point to discovery service.
You can also override entityID on /Login query string, or in RequestMap/htaccess.
<SSO entityID="">

Enter [your_support_email_address]:


        Allows overriding of error template information/filenames. You can
        also add your own attributes with values that can be plugged into the
        templates, e.g., helpLocation below.
        <Errors supportContact="[your_support_email_address]"

Add the filename of the local copy of the eduTEAMS proxy's metadata
       <!-- Example of locally maintained metadata. -->
        <MetadataProvider type="XML" validate="true" path="partner-metadata.xml"/>
       <!-- Metadata for the eduTEAMS proxy -->
       <MetadataProvider type="XML" validate="true" path="" />

Now save a copy of the eduTEAMS proxy metadata to the file /etc/shibboleth/


wget "https://<your-proxy-endpoint>/metadata/frontend.xml" -O /etc/shibboleth/

Finally, set up the signing and encryption certificates.
Please note the filenames used for the signing and encryption certificates. See note below the following snippet for help with these files if required.

        <!-- Simple file-based resolvers for separate signing/encryption keys. -->
        <CredentialResolver type="File" use="signing"
            key="sp-key.pem" certificate="sp-cert.pem"/>
        <CredentialResolver type="File" use="encryption"
            key="sp-key.pem" certificate="sp-cert.pem"/>

You can use the command shib-keygen to create the signing and encryption pairs in the correct directory:

shib-keygen -h [your_sp_domain]


cd /etc/shibboleth/

shib-keygen -h

Next, edit the file /etc/shibboleth/attribute-map.xml

The eduTEAMS service provides a number of attributes for users who have authenticated. The attribute "eduPersonUniqueId" (see Attributes available to Relying Parties#eduTEAMSIdentifier) is the preferred attribute for identifying a remote user, and works alongside the REMOTE_USER="eduPersonUniqueId" edit you made in the shibboleth2.xml file.

The other "Attribute name=" lines refer to the remaining attributes nominally made available by the eduTEAMS service.

Add the following lines before the closing "</Attributes>" :

   <Attribute name="urn:oid:" id="eduPersonUniqueId">
      <AttributeDecoder xsi:type="StringAttributeDecoder" caseSensitive="false"/>

   <Attribute name="urn:oid:2.16.840.1.113730.3.1.241" id="displayName"/>
   <Attribute name="urn:mace:dir:attribute-def:givenName" id="givenName"/>
   <Attribute name="urn:oid:" id="surname"/>
   <Attribute name="urn:oid:0.9.2342.19200300.100.1.3" id="email"/>
   <Attribute name="urn:oid:" id="voPesonExternalAffiliation"/>
   <Attribute name="urn:oid:" id="eduPersonAssurance"/>
   <Attribute name="urn:oid:" id="eduPersonOrcid"/>

2. Apache configuration

You will need to configure Apache to recognize Shibboleth as an authorization "gatekeeper".

You can do this at the VirtualHost level, for example. Here we show a very basic example. Other recipes are available. See for instance the Shibboleth Wiki at

   <Location />
      AuthType shibboleth
      <IfVersion < 2.3>
         ShibCompatWith24 On
      ShibRequestSetting requireSession true
      ShibUseEnvironment On
      require shibboleth

2a. Entitlements (authorization)

An authenticated user will have a number of "entitlements" associated with their account.

These entitlements are presented to your SP in the form of the following:

Attribute FriendlyName="eduPersonEntitlement" Name="urn:oid:" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"

 - within the SAML assertion.

The apache webserver populates the server environment with the variable "entitlements" and populates it accordingly.

See the example to the right.

            <ns1:Attribute FriendlyName="eduPersonEntitlement"
                <ns1:AttributeValue xmlns:xs=""
                <ns1:AttributeValue xmlns:xs=""
                <ns1:AttributeValue xmlns:xs=""
                <ns1:AttributeValue xmlns:xs=""
                <ns1:AttributeValue xmlns:xs=""

.... Is presented to your Apache instance as:

[entitlement] =>;;;;

 - that is, a colon (":") separated list.

Apache also allows server and .htaccess - level directives to control access.


<Location /login>
   AuthType shibboleth
   ShibRequestSetting requireSession 1
   ShibUseEnvironment On
      Require shib-attr entitlement ""

3. Restarting the shibd and apache2 services

systemctl restart apache2 && systemctl restart shibd

You can run the command

shibd -t

to check for errors, and also look inside the log file


in case things do not work first time (for example, file permissions on the local copy of the proxy's metadata)

4. Conclusion

You should now have a working integration of Apache and Shibboleth v3 SP services on your machine.

  • No labels