Configure Shibboleth as SAML2 IDP

Shibboleth  is one of a most popular SAML2 IDP that is widely used.  I tried to configure shibboleth  as SAML2 IDP. In this post i am going to share these steps with you. I hope that would be useful for you also.  My Operating System  was Ubunutu.

Step 1. Download  latest version of  shibboleth IDP from here

Step 2. Extract in to your file system.

Step 3. Go to root directory and run install script.  This would install shibboleth in to given location in your file system.  You would be promoted with few questions as in following.

Please note :  If you are not provided a  fully qualified hostname during installation, It would create an error.  Basically it should exactly match the format suggested by shibboleth. i.e. (There is a regex pattern in build.xml file. You can modify it as you want)

The installation path that is given,  lets call it as IDP_HOME. Also this installation would create a key store which can be found at  IDP_HOME/credentials directory  and war file which can be found at  IDP_HOME/war directory.

Step 4.  First let configure a user store with shibboleth. We can use LDAP based existing user store for this.

Open login.config file which can be found at IDP_HOME/conf directory and configure your LDAP user store details.  Following is the sample configurations for my LDAP user store

ShibUserPassAuth {
edu.vt.middleware.ldap.jaas.LdapLoginModule required

Step 5.  Enable username/password login handler from handler.xml file which can be found at IDP_HOME/conf directory.

<ph:LoginHandler xsi:type="ph:UsernamePassword"

Step 6. Configure logging level from logging.xml  file can be found at IDP_HOME/conf directory.  All the logs files would be saved at  IDP_HOME/logs.  This would probably help you to trouble shooting the issues.

Step 7.  Now let deploy idp.war file in a web application server.  Here i am using Apache Tomcat for this.

Copy  IDP_HOME/war/idp.war  in to <TOMCAT_HOME>/webapps directory

Step 8.  Enable HTTPS in tomcat.  Locate the server.xml at <TOMCAT_HOME>/conf directory and configure HTTPS connector.  Sample configuration would be as follows.

 <Connector port="8443"
 keystorePass="password" />

Step 10. Start tomcat server  by running  catalina script.

Step 11. Check status of the server by using


How you are done with configuration the Shibboleth…..  There are some additional steps that may important for you….

Please note, By default, Shibboleth adds Transient ID as NameID in the Subject element of the SAML Assertion.

(The Transient ID attribute definition exposes a randomly generated, short-lived, opaque identifier that can later be mapped back to the user by a Transient principal connector.)

However, if you want to add the login name in to the SAML Assertion , you need to do following configuration.

Step 12.   Configure principal id as the NameID in SAML Assertion.

Please comment following default configuration in  IDP_HOME/conf/attribute-resolver.xml  file.

  &lt;!--resolver:AttributeDefinition id=&quot;transientId&quot; xsi:type=&quot;ad:TransientId&quot;&gt;
 &lt;resolver:AttributeEncoder xsi:type=&quot;enc:SAML1StringNameIdentifier&quot; nameFormat=&quot;urn:mace:shibboleth:1.0:nameIdentifier&quot;/&gt;
 &lt;resolver:AttributeEncoder xsi:type=&quot;enc:SAML2StringNameID&quot; nameFormat=&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:transient&quot;/&gt;

Please add following configuration to replace above

     &lt;resolver:AttributeDefinition id=&quot;principalId&quot; xsi:type=&quot;PrincipalName&quot; xmlns=&quot;urn:mace:shibboleth:2.0:resolver:ad&quot;&gt;
        &lt;resolver:AttributeEncoder xsi:type=&quot;SAML2StringNameID&quot; xmlns=&quot;urn:mace:shibboleth:2.0:attribute:encoder&quot; nameFormat=&quot;urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified&quot; /&gt;

Step 13.   Configure new policy for principal id.

Please comment following default configuration in  IDP_HOME/conf/attribute-resolver.xml  file.

  &lt;!--afp:AttributeFilterPolicy id=&quot;releaseTransientIdToAnyone&quot;&gt;
 &lt;afp:PolicyRequirementRule xsi:type=&quot;basic:ANY&quot;/&gt;
 &lt;afp:AttributeRule attributeID=&quot;transientId&quot;&gt;
 &lt;afp:PermitValueRule xsi:type=&quot;basic:ANY&quot;/&gt;

Please add following configuration to replace above

&lt;afp:AttributeFilterPolicy id=&quot;releasePrincipalIdToAnyone&quot;&gt;
&lt;afp:PolicyRequirementRule xsi:type=&quot;basic:ANY&quot;/&gt;
&lt;afp:AttributeRule attributeID=&quot;principalId&quot;&gt;
&lt;afp:PermitValueRule xsi:type=&quot;basic:ANY&quot;/&gt;
Discuss this article on Stack Overflow


Leave a Reply

Your email address will not be published. Required fields are marked *