:orphan: .. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Setup Shibboleth ================ ----------------------------------------- Configure Apache HTTPD for mod_shibboleth ----------------------------------------- Follow the steps outlined at: `Running Keystone in HTTPD`_. .. _`Running Keystone in HTTPD`: ../apache-httpd.html You'll also need to install `Shibboleth `_, for example: .. code-block:: bash $ apt-get install libapache2-mod-shib2 Configure your Keystone virtual host and adjust the config to properly handle SAML2 workflow: Add this *WSGIScriptAliasMatch* directive to your public vhost configuration:: WSGIScriptAliasMatch ^(/v3/OS-FEDERATION/identity_providers/.*?/protocols/.*?/auth)$ /usr/local/bin/keystone-wsgi-public/$1 Make sure the *keystone.conf* vhost file contains a ** directive for the Shibboleth module and a ** directive for each identity provider:: SetHandler shib ShibRequestSetting requireSession 1 AuthType shibboleth ShibExportAssertion Off Require valid-user ShibRequireSession On ShibRequireAll On .. NOTE:: * ``mapped`` is the name of the `protocol that you will configure `_ * ``myidp`` is the name associated with the `IdP in Keystone `_ * The ``ShibRequireSession`` and ``ShibRequireAll`` rules are invalid in Apache 2.4+. * You are advised to carefully examine `Shibboleth Apache configuration documentation `_ Enable the ``shib2`` module, for example: .. code-block:: bash $ a2enmod shib2 Restart Apache, for example: .. code-block:: bash $ service apache2 restart --------------------------- Configuring shibboleth2.xml --------------------------- Once you have your Keystone vhost (virtual host) ready, it's then time to configure Shibboleth and upload your Metadata to the Identity Provider. Create a new keypair for Shibboleth with: .. code-block:: bash $ shib-keygen -y The newly created key file will be stored under ``/etc/shibboleth/sp-key.pem``. Configure your Service Provider by editing ``/etc/shibboleth/shibboleth2.xml`` file. You will want to change five settings: * Set the SP entity ID. This value usually has the form of a URI but it does not have to resolve to anything. It must uniquely identify your Service Provider to your Identity Provider. .. code-block:: xml * Set the IdP entity ID. This value is determined by the IdP. For example, if Keystone is the IdP: .. code-block:: xml Example if testshib.org is the IdP: .. code-block:: xml * Remove the discoveryURL lines unless you want to enable advanced IdP discovery. * Add a MetadataProvider block. The URI given here is a real URL that Shibboleth will use to fetch metadata from the IdP. For example, if Keystone is the IdP: .. code-block:: xml Example if testshib.org is the IdP: .. code-block:: xml You are advised to examine `Shibboleth Service Provider Configuration documentation `_ The result should look like (The example shown below is for reference only, not to be used in a production environment): .. code-block:: xml SAML2 SAML1 SAML2 Local If keystone is your IdP, you will need to examine your attributes map file ``/etc/shibboleth/attribute-map.xml`` and add the following attributes: .. code-block:: xml For more information see the `attributes documentation `_ Once you are done, restart your Shibboleth daemon and apache: .. _`external authentication`: ../external-auth.html .. code-block:: bash $ service shibd restart $ service apache2 restart Check ``/var/log/shibboleth/shibd_warn.log`` for any ERROR or CRIT notices and correct them. Upload your Service Provider's metadata file to your Identity Provider. You can fetch it with: .. code-block:: bash $ wget http://mysp.example.com/Shibboleth.sso/Metadata This step depends on your Identity Provider choice and is not covered here. If keystone is your Identity Provider you do not need to upload this file.