Shibboleth Installation Notes
NOTE: the original content of this page, containing notes from a meeting between Jasper Tredgold and Graham Klyne at ILRT Bristol to learn about Jasper's work to use Shibboleth with portals, has been moved to SakaiVre/ShibbolethInstallNotes-20060322. This page now contains actual installation notes for a demonstration/test environment, using WebAuth [7] to provide primary authentication and controlling access to pages in a Sakai portal.
Contents:
Contents
1. Prerequisites
- Apache HTTPD
Apache HTTPD configured to listen for SSL connections on ports 443 and 8443; e.g. add the following to /etc/httpd/conf.d/ssl.conf:
Listen 8443 <VirtualHost _default_:8443> SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP SSLVerifyClient optional_no_ca SSLVerifyDepth 10 SSLOptions +StdEnvVars +ExportCertData SSLCertificateFile /etc/httpd/conf.d/oucs-sakai-vre-demo.bossie-cert SSLCertificateKeyFile /etc/httpd/conf.d/oucs-sakai-vre-demo.key ErrorLog logs/ssl_error_log TransferLog logs/ssl_access_log </VirtualHost>But also note possible problems with SELinux: see ApacheHttpdNotes#FailedToBind.
Apache mod_jk (see TomcatNotes#JKConnector)
Tomcat (see TomcatNotes
Configure Tomcat to accept JK connections from localhost only. Edit the AJP connector configuration in server.xml to include an address attribute, thus:
<!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" address="127.0.0.1" />
WebAuth (see: //wiki.oss-watch.ac.uk/WebAuthNotes)
Configure WebAuth to provide authentication to the Shibboleth IdP. Modify /etc/httpd/conf.d/webauth.conf to contain the following:
<Location /shibboleth-idp/SSO> WebAuthExtraRedirect on AuthType WebAuth require valid-user </Location>
See also SakaiVre/MachineStatus, which has information about the host platform we are using, and in particular has a list of key services used or added, locations of log files, etc. There are some further notes about transferrig the Shibboleth service provider (SP) installtion to a Debian-based system at DebianNotes.
2. Install Shibboleth Identity Provider
The basic plan is set out in https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/InQueueIdPInstall. See also SakaiVre/ShibbolethInstallNotes-20060322.
2.1. More prerequisites
Using Tomcat 5.5 with Java 1.5, Apache 2 and mod_jk connector.
Create file /etc/httpd/conf.d/shibboleth.conf:
<IfModule !mod_jk.c> LoadModule jk_module libexec/mod_jk.so </IfModule> # JkWorkersFile "/opt/apache-tomcat/apache-tomcat-5.5.16/conf/jk/workers.properties" # JkLogFile "/opt/apache-tomcat/apache-tomcat-5.5.16/logs/mod_jk.log" JkWorkersFile "/etc/httpd/conf.d/workers.properties" JkLogFile "/var/log/httpd/mod_jk.log" # JkLogLevel emerg JkLogLevel debug JkMount /shibboleth-idp/* ajp13w JkMount /jsp-examples/* ajp13w
Check that the declarations in the named JkWorkersFile file match the JkMount commands; e.g.
# The workers that jk should create and work with # worker.list=wlb,jkstatus,ajp13w # # Defining a worker named ajp13w and of type ajp13 # Note that the name and the type do not have to match. # worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8009 # # Defining a load balancer # worker.wlb.type=lb worker.wlb.balance_workers=ajp13w # # Define status worker # worker.jkstatus.type=status
Edit file /opt/apache-tomcat/apache-tomcat-5.5.16/conf/server.xml, so that the element <Service name="Catalina"> contains this connector configuration, with the address="127.0.0.1" to prevent off-host access to the Tomcat instance via the AJP connector protocol:
<!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" address="127.0.0.1" tomcatAuthentication="false" />
(The Shibboleth installation instructions refer to an <Ajp13Connector> element in server.xml, but this appears to be incorrect; a <Connector> element is used. See also http://wiki.oss-watch.ac.uk/TomcatNotes for more comments about configuring Tomcat to use the JK connector. The Tomcat AJP connector configuration reference is at http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html.)
Create file /etc/httpd/conf.d/WebAuth.conf to provide WebAuth authentication to the Shibboleth IdP:
# Make webauth available LoadModule webauth_module modules/mod_webauth.so # Set locations for various files used by mod_webauth WebAuthKeyring webauth/keyring WebAuthKeytab webauth/keytab WebAuthServiceTokenCache webauth/service_token_cache WebAuthCredCacheDir webauth/cred_cache # Point to the Oxford Webauth service WebAuthLoginURL https://webauth.ox.ac.uk/login WebAuthWebKdcURL https://webauth.ox.ac.uk:8443/webkdc-service/ WebAuthWebKdcPrincipal service/webkdc@OX.AC.UK # If you're having trouble switch on debugging WebAuthDebug on # For each location that you want to protect using Webauth you should add a section like: <Location /shibboleth-idp/SSO> WebAuthExtraRedirect on AuthType WebAuth require valid-user </Location>
This assumes that WebAuth has been installed and tested (see WebAuthNotes). Clearly, some of these values are specific to the Local WebAuth deployment at Oxford.
2.2. Generate required PKI values
See https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/InQueueIdPInstall.
The IdP details have also been regsitered with inQueue for testing purposes; this is the metadata returned:
1.3 Metadata:
<EntityDescriptor entityID="urn:mace:inqueue:oucs.ox.ac.uk">
<IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol urn:mace:shibboleth:1.0">
<Extensions>
<shib:Scope xmlns:shib="urn:mace:shibboleth:metadata:1.0">oucs.ox.ac.uk</shib:Scope>
</Extensions>
<KeyDescriptor use="signing">
<ds:KeyInfo>
<ds:KeyName>sakai-vre-demo.oucs.ox.ac.uk</ds:KeyName>
</ds:KeyInfo>
</KeyDescriptor>
<ArtifactResolutionService
Binding="urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
Location="https://sakai-vre-demo.oucs.ox.ac.uk/shibboleth-idp/Artifact"
index="1"/>
<NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>
<SingleSignOnService
Binding="urn:mace:shibboleth:1.0:profiles:AuthnRequest"
Location="https://sakai-vre-demo.oucs.ox.ac.uk/shibboleth-idp/SSO"/>
</IDPSSODescriptor>
<AttributeAuthorityDescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol">
<Extensions>
<shib:Scope xmlns:shib="urn:mace:shibboleth:metadata:1.0">oucs.ox.ac.uk</shib:Scope>
</Extensions>
<KeyDescriptor use="signing">
<ds:KeyInfo>
<ds:KeyName>sakai-vre-demo.oucs.ox.ac.uk</ds:KeyName>
</ds:KeyInfo>
</KeyDescriptor>
<AttributeService
Binding="urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
Location="https://sakai-vre-demo.oucs.ox.ac.uk:8443/shibboleth-idp/AA"/>
<NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>
</AttributeAuthorityDescriptor>
<Organization>
<OrganizationName xml:lang="en">Oxford University (Sakai VRE demo)</OrganizationName>
<OrganizationDisplayName xml:lang="en">Oxford University (Sakai VRE demo)</OrganizationDisplayName>
<OrganizationURL xml:lang="en">http://www.oucs.ox.ac.uk/</OrganizationURL>
</Organization>
<ContactPerson contactType="technical">
<SurName>Graham Klyne</SurName>
<EmailAddress>graham.klyne@oucs.ox.ac.uk</EmailAddress>
</ContactPerson>
<ContactPerson contactType="administrative">
<SurName>Graham Klyne</SurName>
<EmailAddress>graham.klyne@oucs.ox.ac.uk</EmailAddress>
</ContactPerson>
</EntityDescriptor>
1.2 Metadata:
<OriginSite xmlns="urn:mace:shibboleth:1.0" Name="urn:mace:inqueue:oucs.ox.ac.uk">
<Alias>Oxford University (Sakai VRE demo)</Alias>
<Contact Email="graham.klyne@oucs.ox.ac.uk" Name="Graham Klyne" Type="technical"/>
<Contact Email="graham.klyne@oucs.ox.ac.uk" Name="Graham Klyne" Type="administrative"/>
<HandleService
Location="https://sakai-vre-demo.oucs.ox.ac.uk/shibboleth-idp/SSO"
Name="sakai-vre-demo.oucs.ox.ac.uk"/>
<AttributeAuthority
Location="https://sakai-vre-demo.oucs.ox.ac.uk/shibboleth-idp/AA"
Name="sakai-vre-demo.oucs.ox.ac.uk"/>
<Domain regexp="false">oucs.ox.ac.uk</Domain>
</OriginSite>
Intended use of Shibboleth:
Test and demonstration deployment of a Shibboleth federation for a multi-site Sakai VRE system
2.3. Install the Shibboleth IdP
See https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/InQueueIdPInstall.
Download IdP software from http://shibboleth.internet2.edu/downloads/shibboleth-idp-1.3.tar.gz.
Run Ant, in our case specifying /opt/shibboleth-idp for the Shibboleth IdP directory, and /opt/apache-tomcat/apache-tomcat-5.5.16 for the Tomcat home directory. Not that if an etc subdirectory exists in the target directory, the old configuration is not overwritten or updated in any way.
[root@sakai-vre-demo shibboleth-idp-1.3c-install]# ./ant Buildfile: build.xml init: install.init: install: Do you want to install the Shibboleth Identity Provider? [Y,n] y What name do you want to use for the Identity Provider web application? [default: shibboleth-idp] init: install.init: install.idp: Deploying the java web application. Do you want to install it directly onto the filesystem or use the tomcat manager application? 1) filesystem (default) 2) manager 1 init: install.init: install.idp.filesystem.prompt: Select a home directory for the Shibboleth Identity Provider [default: /usr/local/shibboleth-idp] /opt/shibboleth-idp Enter tomcat home directory [default: /usr/local/tomcat] /opt/apache-tomcat/apache-tomcat-5.5.16 init: install.init: compile: ext-invoke: build-util: Building jar: /opt/shibboleth/shibboleth-idp-1.3c-install/lib/shib-util.jar install.url: package-idp: Copying 1 file to /opt/shibboleth/shibboleth-idp-1.3c-install/webAppConfig ext-invoke: Building war: /opt/shibboleth/shibboleth-idp-1.3c-install/dist/shibboleth-idp.war Deleting: /opt/shibboleth/shibboleth-idp-1.3c-install/webAppConfig/idp.xml install.idp.filesystem: Copying 1 file to /opt/apache-tomcat/apache-tomcat-5.5.16/webapps Copying 11 files to /opt/shibboleth-idp/lib Copying 4 files to /opt/shibboleth-idp/endorsed Copying 7 files to /opt/shibboleth-idp/bin Created dir: /opt/shibboleth-idp/logs init: install.init: install.url: Skipping urlconvert as property idp.home.url has already been set. Skipping urlconvert as property sp.home.url has already been set. install.idp.filesystem.config: Created dir: /opt/shibboleth-idp/etc Copying 12 files to /opt/shibboleth-idp/etc Moving 1 files to /opt/shibboleth-idp/etc ext-invoke: savePropertyFile: Updating property file: /opt/shibboleth/shibboleth-idp-1.3c-install/build.properties BUILD SUCCESSFUL Total time: 2 minutes 34 seconds
At this point, browsing to https://sakai-vre-demo.oucs.ox.ac.uk/shibboleth-idp/SSO causes the following error, which is progress of a sort because it is clearly coming from the Shibboleth Identity Provider:
Shibboleth Identity Provider Failure The Shibboleth authentication system experienced a technical failure. Please email root@localhost and include the following error message: Identity Provider failure at (/shibboleth-idp/SSO) org.opensaml.SAMLException: Invalid data from Service Provider: no target URL received.
- This is entirely reasonable, as it is not intended that one browse directly to the IDP in this way, but rather to be redirected there by the Shibboleth Service Provider, which presumably supplies a copy of the original target URI. So even the error message makes sense.
To send a request to the newly created IdP, try browsing to https://wayf.internet2.edu/InQueue/sample.jsp, assuming that the InQueue federation joining procedure has been completed, and selecting the appropriate identity provider. At this stage, authentication should be requested, and a page returned, but no authentication assertion will be provided.
2.4. Configure the IdP
Note: errors in the configuration can result in obscure failures, with reports like "IdP servlet not available". In order to diagnose these problems, it will be necessary to activate appropriate logging through Tomcat and cataline: see http://tomcat.apache.org/tomcat-5.5-doc/logging.html and TomcatNotes#EnablingServletLogging for more details.
Make a copy of file /opt/shibboleth-idp/etc/idp.xml:
cp /opt/shibboleth-idp/etc/idp.xml /opt/shibboleth-idp/etc/idp-orig.xml
- (This is for later reference when things don't work as planned.)
Edit file /opt/shibboleth-idp/etc/idp.xml:
Change attributes AAUrl, resolverConfig, defaultrelyingParty, providerId on the <IdpConfig> element:
<IdPConfig xmlns="urn:mace:shibboleth:idp:config:1.0" xmlns:cred="urn:mace:shibboleth:credentials:1.0" xmlns:name="urn:mace:shibboleth:namemapper:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mace:shibboleth:idp:config:1.0 ../schemas/shibboleth-idpconfig-1.0.xsd" AAUrl="https://sakai-vre-demo.oucs.ox.ac.uk:8443/shibboleth-idp/AA" resolverConfig="file:/opt/shibboleth-idp/etc/resolver.xml" defaultRelyingParty="urn:mace:inqueue" providerId="urn:mace:inqueue:oucs.ox.ac.uk">
The values used here are taken from the InQueue metadata returned following registration.
Remove the example <RelyingParty> element, and uncomment and edit the InQueue example thus:
<!-- InQueue example --> <RelyingParty name="urn:mace:inqueue" signingCredential="inqueue_cred"> <NameID nameMapping="shm"/> </RelyingParty>
For diagnostic output, edit the <Logging> element level attributes:
<Logging> <ErrorLog level="DEBUG" location="file:/opt/shibboleth-idp/logs/shib-error.log" /> <TransactionLog level="DEBUG" location="file:/opt/shibboleth-idp/logs/shib-access.log" /> </Logging>
Edit the <Credentials> element, removing the <FileResolver Id="example_cred"> element, uncommenting the <FileResolver Id="inqueue_cred"> element and editing the <Key> and <Certificate> elements to reference the files corresponding to the certificater information sent when registering with the InQueue federation:
<Credentials xmlns="urn:mace:shibboleth:credentials:1.0"> <!-- InQueue example (Deployments would need to generate an InQueue-compatible certificate) --> <FileResolver Id="inqueue_cred"> <Key format="PEM"> <Path>file:/opt/shibboleth-idp/etc/oucs-sakai-vre-demo.key</Path> </Key> <Certificate format="PEM"> <Path>file:/opt/shibboleth-idp/etc/oucs-sakai-vre-demo.bossie-cert</Path> </Certificate> </FileResolver> </Credentials>
Place a copy of the InQueue metadata file at the link provided in the join-up acknowledgement email (https://wayf.internet2.edu/InQueue/IQ-metadata.xml) in the shibboleth-idp/etc directory, and edit the <MetadataProvider> element in idp.xml to point to the file copy; e.f.:
<MetadataProvider type="edu.internet2.middleware.shibboleth.metadata.provider.XMLMetadata" uri="file:/opt/shibboleth-idp/etc/InQueue-metadata.xml"/>
Other points to check if there are problems:
Is logging enabled? See notes at TomcatNotes#EnablingServletLogging.
Ensure that a copy of the private key and corresponding certificate are available at the locations mentioned in the <FileResolver Id="inqueue_cred"> element in idp.xml.
We experienced a problem because the certificate file obtained from Bossie contained two identical copies of the same certificate. This problem was fixed by deleting one copy.
If this error is seen "org.opensaml.SAMLException: Unauthenticated principal. This protocol handler requires that authentication information be provided from the servlet container", check that the Tomcat server.xml file has been updated to use external authentication for port 8009 connections (See also TomcatNotes#JKConnector):
<!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" address="127.0.0.1" tomcatAuthentication="false" />
2.4.1. IdP and attribute results
Validate the IdP by browsing to https://wayf.internet2.edu/InQueue/sample.jsp, which, after performing appropriate authentication steps, will give results something like the following (this result was generated using the default attribute resolver logic with resolverConfig="resolver.xml", not the LDAP attribute resolver):
<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" InResponseTo="_70517b494ca227db430c99d0da8d3991" IssueInstant="2006-06-12T15:11:17.683Z" MajorVersion="1" MinorVersion="1" ResponseID="_933465c892e9a4d20d42d9489a89bacb" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Status> <StatusCode Value="samlp:Success"/> </Status> <Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" AssertionID="_dc5bf8c090aa651b1d45af1b5c709574" IssueInstant="2006-06-12T15:11:17.682Z" Issuer="urn:mace:inqueue:oucs.ox.ac.uk" MajorVersion="1" MinorVersion="1"> <Conditions NotBefore="2006-06-12T15:11:17.682Z" NotOnOrAfter="2006-06-12T15:41:17.682Z"> <AudienceRestrictionCondition> <Audience>urn:mace:inqueue:example.edu</Audience> <Audience>urn:mace:inqueue</Audience> </AudienceRestrictionCondition> </Conditions> <AttributeStatement> <Subject> <NameIdentifier Format="urn:mace:shibboleth:1.0:nameIdentifier" NameQualifier="urn:mace:inqueue:oucs.ox.ac.uk"> _7a2070df4287a6497ba2ed068abbbfb3 </NameIdentifier> </Subject> <Attribute AttributeName="urn:mace:dir:attribute-def:eduPersonAffiliation" AttributeNamespace="urn:mace:shibboleth:1.0:attributeNamespace:uri"> <AttributeValue>member</AttributeValue> </Attribute> </AttributeStatement> </Assertion> </Response>
If the attribute assertion is blank, but the response otherwise indicates that an authenticated user has been established, then there is probably a problem with the attribute resolver setup. In this case, here are a few things to look for:
- Does the Apache SSL_access_log file report any accesses to port 8443?
- Does the firewall allow incoming TCP connections on port 8443?
Is the Apcahe Web serverb listening on port 8443? (See note above under "Prerequisites", and also note possible problems with SELinux per ApacheHttpdNotes#FailedToBind.)
2.5. Configure an LDAP attribute authority (AA)
The attribute authority configuration file is named by the resolverConfig attribute of the <IdPConfig> element in file IdP.xml. A skeleton file resolver.ldap.xml is provided as a starting point for configuring an LDAP attribute provider. We are using an LDAP server at ldap.ox.ac.uk.
Appliy the following changes to the skeleton file resolver.ldap.xml to configure attribute resolution via LDAP:
- Define a JNDI connector, identified in our case as "directoryOUCS", for the LDAP server:
<JNDIDirectoryDataConnector id="directoryOUCS"> <Search filter="oucsUsername=%PRINCIPAL%"> <Controls searchScope="SUBTREE_SCOPE" returningObjects="false" /> </Search> <Property name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory" /> <Property name="java.naming.provider.url" value="ldap://ldap.ox.ac.uk:389/ou=people,dc=ox,dc=ac,dc=uk" /> </JNDIDirectoryDataConnector>This configuration assumes that all attributes to be returned relate to LDAP subjects [[[term?]]] having distinguished names with leading components "ou=people,dc=ox,dc=ac,dc=uk". [[[Check the detail here; see JNDI for details.]]]Note that LDAP may be used to store binary Java objects, but this introduces a considerable degree of additional configuration complexity. In the above example, the attribute returningObjects="false" avoids this complexity.
- For each attribute to be returned from LDAP, edit or create an entry of the form:
<SimpleAttributeDefinition id="urn:mace:dir:attribute-def:oucsStatus"> <DataConnectorDependency requires="directoryOUCS"/> </SimpleAttributeDefinition>
- "id=..." indicates the URI used by Shibboleth to identify this value, and the "requires=" attribute indicates that the directoryOUCS connector defined above is used to obtain the value. [[[What about the LDAP attribute name?]]]
- Some attributes (or is it just eduP:ersonAffiliation?) are provided by the Shibboleth default attribute provider. For these, include configuration sections like this:
<!-- To use these attributes, you should change the smartScope value to match your site's domain name. --> <SimpleAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonScopedAffiliation" smartScope="oucs.ox.ac.uk"> <AttributeDependency requires="urn:mace:dir:attribute-def:eduPersonAffiliation"/> </SimpleAttributeDefinition>
The following is used by service providers that need to save additional information (e.g. personalization) on a per-user basis, without actually knowing who the user actually is. More explanation at http://sdss.ac.uk/wiki/wiki.pl?AttributeUsage:
<PersistentIDAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonTargetedID" scope="oucs.ox.ac.uk" sourceName="cn"> <DataConnectorDependency requires="directory"/> <Salt keyStorePath="file:/opt/shibboleth-idp/etc/persistent.jks" keyStoreKeyAlias="handleKey" keyStorePassword="shibhs" keyStoreKeyPassword="shibhs"/> </PersistentIDAttributeDefinition>
Also, an attribute release policy needs to be established, referenced by <ReleasePolicyEngine> in idp.xml. In a default installation, the policy is established by file arps/arp.site.xml; e.g.:
<?xml version="1.0" encoding="UTF-8"?> <AttributeReleasePolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mace:shibboleth:arp:1.0" xsi:schemaLocation="urn:mace:shibboleth:arp:1.0 shibboleth-arp-1.0.xsd" > <Description>Simplest possible ARP.</Description> <Rule> <Target> <AnyTarget/> </Target> <Attribute name="urn:mace:dir:attribute-def:eduPersonAffiliation"> <AnyValue release="permit"/> </Attribute> <Attribute name="urn:mace:dir:attribute-def:eduPersonScopedAffiliation"> <AnyValue release="permit"/> </Attribute> <Attribute name="urn:mace:dir:attribute-def:initials"> <AnyValue release="permit"/> </Attribute> <Attribute name="urn:mace:dir:attribute-def:oucsStatus"> <AnyValue release="permit"/> </Attribute> </Rule> </AttributeReleasePolicy>
2.6. Install the Shibboleth Service Provider module
There are two versions of the service provider module: one is implemented in C/C++ as an Apache server module and the other as a Java module (typically used as part of a servlet engine filter). The Java version for Shibboleth 1.3 is no longer being developed, and is not fully up to date, so we are using the C/C++ version. New Java and C/C++ service provider modules are being developed for Shibboleth 2.
(There are some further notes about transferrig the Shibboleth service provider (SP) installtion to a Debian-based system at DebianNotes.)
Our first attempt to install the service provider module from binary RPMs failked. The procedure followed for this was:
Down RPMs from Shibboleth download site http://shibboleth.internet2.edu/downloads/RPMS/i386/RHE/4.2/, all RPM files in that directory.
Following the instructions at page https://authdev.it.ohio-state.edu/twiki/bin/view/GridShib/SPOnRedHatFedoraCore4.
- The sanity check passed OK, but the first install (of log4cpp) failed with the following error:
[root@sakai-vre-demo RPMS]# rpm -ihv log4cpp* error: Failed dependencies: libstdc++.so.6(CXXABI_1.3.1) is needed by log4cpp-0.3.5rc1-1.i386 libstdc++.so.6(GLIBCXX_3.4.4) is needed by log4cpp-0.3.5rc1-1.i386
At this point, we have decided to go for Shibboleth instllation from source, rather than to try and tweak the host system to resolve the dependencies.
Installing Shibboleth SP from source (instructions at https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/SPBuildRPMs):
First, ensure that the rpmbuild software is installed (i.e. that command rpmbuild is available). If necessary, use:
yum install rpm-build
Check that package doxygen is installed. Use:
yum install doxygen
Download the various source RPMs from http://shibboleth.internet2.edu/downloads/SRPMS/, saving them to /usr/src/redhat/SRPMS/:
cd /usr/src/redhat/SRPMS/ wget -r -l1 --nodirectories -A.rpm http://shibboleth.internet2.edu/downloads/SRPMS/
Run rpm -q on each of the downloaded packages to confirm that the checksums are all correct. (Signatures may be not confirmed, as we haven't obtained and configured the corresponding public key.)
- Build each of the packages with
for file in *.rpm; do rpmbuild --rebuild $file; done
- Install the packages
yum install /usr/src/redhat/RPMS/*
Note that this assumes that you have no other packages in this staging area.
These instructoins are adapted from those at https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/SPBuildRPMs. Note that some of the minor version numbers of packages obtained from the download diretory bay be different from those in the instructions. When performing the step "Building and installaing OpenSAML", follow the instructions for the "elegant route", noting that the required source file will have been downloaded by the wget command given above, there being a copy of cxxtest in the Shibboleth SRPMS directory.
At the end of this process, the Shibboleth Service Provider module is installed. A new file shib.conf is created in the Apache HTTPD configuration directory (/etc/httpd/conf.d/), a new directory /etc/shibboleth/ is created containing several files including shibboleth.xml, which is referenced by the new shib.conf file. Also installed are some XML schema and transform files in directory /usr/share/xml/shibboleth/.
2.7. Configure the Service Provider module
We are using two configuration files in /etc/httpd/conf.d/:
shib-idp.conf configures Apache httpd to use the IdP part of Shibboleth, installed and tested previously, and
shib-sp.conf configures Apache httpd to use the SP part of Shibboleth, just installed. This file is created by renaming and editing the file shib.conf.
Configuring the Shiboleth SP is a bit of a maze, and the installation documentation isn't too helpful ("Modify shibboleth.xml: Mods too numerous to mention..." - https://authdev.it.ohio-state.edu/twiki/bin/view/GridShib/SPOnRedHatFedoraCore4). The most helpful instructions were found at: http://www.switch.ch/aai/docs/shibboleth/SWITCH/1.3/sp/install-sp-1.3-debian.html.
Create some test files in the web server area under /var/www/html/shibtest/, and edit file /etc/httpd/conf.d/shib-sp.conf to contain:
<Location /shibtest> AuthType shibboleth ShibRequireSession On require valid-user </Location>
Thus, we aim to test our Shibbeleth service provider configuration by browsing to https://sakai-vre-demo.oucs.ox.ac.uk/shibtest/
The next change needed seems to be to configure the IdP address in /etc/shibboleth/shibboleth.xml:
<!-- This example directs users to the InQueue federation's WAYF service. --> <SessionInitiator isDefault="true" id="IQ" Location="/WAYF/InQueue" Binding="urn:mace:shibboleth:sp:1.3:SessionInit" wayfURL="https://wayf.internet2.edu/InQueue/WAYF" wayfBinding="urn:mace:shibboleth:1.0:profiles:AuthnRequest"/>
Start the shibd daemon:
service shibd start
See also the notes in https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/SPLinuxInstall, setion 3, item 2. Now, the test access returns a different error:
Unauthorized Identity Provider The identity provider supplying your login credentials is not authorized for use with this service. You should inquire with your identity provider as to whether this service is intended to be enabled for your use. Please include the following error message in any email: Metadata lookup failure at (https://sakai-vre-demo.oucs.ox.ac.uk/Shibboleth.sso/SAML/POST) Session Creation Error
- Configure the identity provider:
In <Local>/<RequestMapProvider>:
<Host name="sakai-vre-demo.oucs.ox.ac.uk"> <Path name="secure" authType="shibboleth" requireSession="true"/> </Host>In <Local>/<implementation>/<ISAPI>:
<Site id="1" name="sakai-vre-demo.oucs.ox.ac.uk"> <!-- <Alias>spalias.example.org</Alias> --> </Site>In <Applications>:
<Applications id="default" providerId="https://https://sakai-vre-demo.oucs.oc.ac.uk/shibboleth/shibboleth" homeURL="https://sp.example.org/index.html" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">
Copy InQueue metadata to /etc/shibboleth, and configure federation metadata. There is an initial "starter" InQueue metadata file, and a full metadata file that is made available after the IdP has been accepted by the InQueue federation. Copy the full InQueue metadata file. The configuration to use this looks something like this:
<MetadataProvider type="edu.internet2.middleware.shibboleth.metadata.provider.XMLMetadata" uri="/etc/shibboleth/InQueue-metadata.xml"/>
- Copy the IdP key and certificate files to /etc/Shibboleth, and configure the identity provider credentials:
<CredentialsProvider type="edu.internet2.middleware.shibboleth.common.Credentials"> <Credentials xmlns="urn:mace:shibboleth:credentials:1.0"> <FileResolver Id="inqueue_cred"> <Key> <Path>file:/etc/shibboleth/oucs-sakai-vre-demo.key</Path> </Key> <Certificate> <Path>file:/etc/shibboleth/oucs-sakai-vre-demo.crt</Path> </Certificate> </FileResolver> :
At this stage, we can access our Shibboleth-protected static web page.
2.7.1. Possible problems
If the Shibboleth protected page cannot be accessed, instead showing this error message after the initial authentication has been performed:
Session Creation Failure The inter-institutional access system was unable to successfully build a login session for you at Wed Jun 14 15:04:00 2006 To report this problem, please contact the site administrator at root@localhost. Please include the following message in any email: Session creation failure at (http://sakai-vre-demo.oucs.ox.ac.uk/Shibboleth.sso/SAML/POST) Session Creation Error
and file /var/log/httpd/ssl_error_log shows the following error:
[Wed Jun 14 15:03:42 2006] [error] [client 129.67.100.122] File does not exist: /var/www/html/Shibboleth.SSO [Wed Jun 14 15:03:45 2006] [error] [client 129.67.100.122] Directory index forbidden by rule: /var/www/html/ [Wed Jun 14 15:03:50 2006] [error] [client 129.67.100.122] File does not exist: /var/www/html/Shibboleth.SSO
This may be because the shibd daemon is not running.
3. Passing Shibboleth attributes to applications
Accessing user information above and beyound the mere fact of authentication and authorisation is a significant goal. In our case attributes reside in an LDAP server (which is ultimately updated from core business systems which are beyond the scope of this project) and a made accessible to the Shibboleth IdP which then releases them to applications as they request them. There are a number of configuration steps involved. We're using the Tomcat servlets-examples/servlet/RequestHeaderExample test, which returns a webpage echoing the http headers it recieves.
Configuring the IdP to extract attributes from the LDAP resolver.ldap.xml contains defines connections to LDAP databases and mappings from entries (usually Person entries) to Shibboleth attributes. Out of the box this handles default LDAP attributes very well. At Oxford we don't use the default LDAP schema, so we needed to add some extra details; e.g. to release an LDAP attribute oucsStatus:
<SimpleAttributeDefinition id="urn:mace:dir:attribute-def:oucsStatus"> <DataConnectorDependency requires="directoryOUCS"/> </SimpleAttributeDefinition>
where directoryOUCS is a reference to the LDAP connection.
Configuring an IdP Attribute Release Policy (ARP) arps/arp.site.xml contains a (minimal) list of attributes to be release. We added some of the standard attributes (using the names harvested from resolver.ldap.xml):
<Attribute name="urn:mace:dir:attribute-def:initials"> <AnyValue release="permit"/> </Attribute> <Attribute name="urn:mace:dir:attribute-def:oucsStatus"> <AnyValue release="permit"/> </Attribute> <Attribute name="urn:mace:dir:attribute-def:cn"> <AnyValue release="permit"/> </Attribute>
Configuring the SP Attrubute Acceptance Policy (AAP) AAP.xml in the SP contains a complex logic of which attributes to accept and how to map them to local attributes. Out of the box a full set of standard attributes are present, but need to be uncommented. The selected attrubutes are presented to the application as HTTP header fields. The result appears as:
[[[Can we make the image smaller, and a local attachment?]]]
[[[What about local attributes like oucsStatus?]]]
4. Links
http://tomcat.apache.org/tomcat-5.5-doc/config/ - Tomcat configuration
http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html - Tomcat AJP connector configuration
http://www.dsg.port.ac.uk/events/workshops/VRE05/talks/Jasper%20Tredgold.ppt - Personalisation, Shibboleth and WSRP in the SPIE Project, Jasper Tredgold's presentation to the Sakai VRE demonstrator workshop help in Portsmouth, January 2006.
http://spie.oucs.ox.ac.uk/ - Shibboleth-aware Portals and Information Environments (SPIE) project website
https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/InQueueIdPInstall - Instructions for Shibboleth IdP installation
SakaiVre/ShibbolethInstallNotes-20060322 - Notes about Shibboleth deployment from meeting with Jasper Tredgold
http://webauth.stanford.edu/ - WebAuth Apache module for Kerberos-based authentication. Download and installation instructions: http://webauth.stanford.edu/obtain.html.
4.1. Shibboleth and SPIE project notes
https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/InQueueIdPInstall
https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/TomcatAlone
https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/WebHome
https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/InQueueSPInstall
https://authdev.it.ohio-state.edu/twiki/bin/view/Shibboleth/ConfiguringShibboleth
Java class: uk.ac.portal.spie.pluto.factory.impl.RenderRequestFactoryImpl.java
http://spie.oucs.ox.ac.uk/Wiki.jsp?page=ShibbolethIntegration
http://spie.oucs.ox.ac.uk/attach/ILRTFinalReport/SPIE39-ShibWSRP.pdf
4.2. Other intallation notes
http://www.angel.ac.uk/PERSEUS/deliverables/ShibDependencies.html - contains some notes that clarify the installation instructions cited above).
http://www.angel.ac.uk/SECURe/deliverables/documentation/shibinstall.html - more on setting up Shibboleth
http://kidderminster.ac.uk/kc-rolo/documents/KCROLOShibbolethGuidev1.doc - looks like a good Shibboleth overview and installation document.
http://tomcat.apache.org/tomcat-5.5-doc/logging.html - Contains instructions for enabling Tomcat 5.5 logging.
http://www.lrz-muenchen.de/~hommel/shibboleth/shib13c_on_SuSE10.0.html - another set of instructions for Shibboleth installation, for SuSE Linux.
-- GrahamKlyne 2006-03-22 14:11:29

