
{"id":2031,"date":"2016-07-23T21:11:24","date_gmt":"2016-07-24T01:11:24","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=2031"},"modified":"2016-07-23T21:11:24","modified_gmt":"2016-07-24T01:11:24","slug":"shibboleth-installation-and-configuration","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=2031","title":{"rendered":"Shibboleth Installation and Configuration"},"content":{"rendered":"<table>\n<tr>\n<td>Previous:<\/td>\n<td><a href=\"http:\/\/www.ikriv.com\/blog\/?p=2055\">SAML and shibboleth<\/a><\/td>\n<\/tr>\n<tr>\n<td>Next:<\/td>\n<td><a href=\"http:\/\/www.ikriv.com\/blog\/?p=2072\">Shibbleth: controlling access to resources<\/a><\/td>\n<\/tr>\n<\/table>\n<p><a href=\"https:\/\/shibboleth.net\/\">Shibboleth<\/a> is an open-source SAML implementation that is used for single sign-on. We are developing a SAML IdP, and I was testing it against Shibboleth. Here are some pieces of information that I want to keep for my records. I used Shibboleth with IIS 8.<\/p>\n<p><b>Installation<\/b><\/p>\n<p>I downloaded the latest package from the <a href=\"https:\/\/shibboleth.net\/downloads\/identity-provider\/latest\/\">the download page<\/a>. At the time of writing it was <code>shibboleth-sp-2.5.6.0-win64.msi<\/code>. The installer targets IIS 6, so I had to perform manual steps outlined in the  <a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/NativeSPWindowsIIS7Installer\">IIS 7 Installer page<\/a>.<\/p>\n<p>The scripts on that page more or less work, but watch out for that extra new line before &#8220;\/+[path&#8221;: you will need to remove it for the script to work. If you don&#8217;t, you will get this error<\/p>\n<p><code><font color=\"red\">Handler \"Shibboleth\" has a bad module \"ManagedPipelineHandler\" in its module list<\/font><\/code><\/p>\n<p>If this happens, make sure to repeat the manual steps for mapping <code>.sso<\/code> extension to Shibboleth filter.<\/p>\n<p>After the installation is done, Shibboleth will protect the content of the <code>http:\/\/yourhost\/secure<\/code> virtual directory.<\/p>\n<p><b>Configuration<\/b><\/p>\n<p><a href=\"http:\/\/www.ikriv.com\/dev\/misc\/Shibboleth\/shibboleth2.xml\">My Shibboleth configuration file<\/a>. Note: this is not the actual file we use, some company specific information was removed.<\/p>\n<p>Shibboleth configuration is stored in the <code>shibboleth2.xml<\/code> file. Standard configuration process involves going through the file and replacing default values such as host names with our specific data. However, default configuration uses SAML discovery protocol, which we do not support, so I had to perform more significant modifications:<\/p>\n<ol>\n<li>Copy IdP&#8217;s SAML metadata to Shibboleth configuration directory (<code>C:\\opt\\shibboleth-sp\\etc\\shibboleth<\/code>).<br \/>\n&nbsp;<\/li>\n<li>Add the following node under <code>&lt;ApplicationDefaults&gt;<\/code>:<br \/>\n<code>&lt;MetadataProvider type=\"XML\" file=\"YourIdpMetadata.xml\"\/&gt;<\/code><br \/>\n&nbsp;<\/li>\n<li>Remove <code>&lt;SSO&gt;<\/code> and <code>&lt;Logout&gt;<\/code> nodes under <code>ApplicationDefaults\/Sessions<\/code>.<br \/>\n&nbsp;<\/li>\n<li>Add <code>&lt;SessionInitiator&gt;<\/code> node in their place:<br \/>\n<code>\t    &lt;SessionInitiator type=\"SAML2\" Location=\"\/Login\" isDefault=\"true\" id=\"Intranet\"<br \/>\n                    relayState=\"cookie\" entityID=\"https:\/\/your.idp\/EntityId\"&gt;<br \/>\n            &lt;\/SessionInitiator&gt;<\/code><br \/>\n<small>I am not certain what is the role of the &#8220;location&#8221; attribute. It appears to be ignored: SAML requests are sent to the URL in the metadata.<\/small><br \/>\n&nbsp;<\/li>\n<li>If you leave it at that, Shibboleth will come up with a very cryptic message when you try to access <code>http:\/\/yourhost\/secure<\/code>:<br \/>\n<code><font color=\"red\">Unable to locate a SAML 2.0 ACS endpoint to use for response.<\/font><\/code><br \/>\n&#8220;ACS&#8221; here stands for &#8220;Assertion Consumer Service&#8221;. To get rid of the error, add the following node under <code>&lt;SessionInitiator&gt;<\/code>:<\/p>\n<pre><code>&lt;md:AssertionConsumerService Location=\"\/SAML2\/POST\" index=\"1\"\nBinding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" conf:ignoreNoPassive=\"true\" \/&gt;<\/code><\/pre>\n<p>The documentation <a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/NativeSPAssertionConsumerService\">claims<\/a> that an example is distributed with default <code>shibboleth2.xml<\/code>, but it is no longer the case. However, some examples can be found in the <code>example-shibboleth2.xml<\/code> file.<\/li>\n<\/ol>\n<p><b>Restarting Shibboleth<\/b><\/p>\n<p>Some configuration changes are picked up automatically, but for others you would have to restart Shibboleth. Run the following script as administrator<\/p>\n<p><code><\/p>\n<pre>net stop shibd_default\niisreset\nnet start shibd_default<\/pre>\n<p><\/code><\/p>\n<p><b>Log level<\/b><\/p>\n<p>Log levels are set in configuration file <code>shibd.logger<\/code>. This is a standard log4j configuration file, change &#8220;INFO&#8221; in the second line to &#8220;DEBUG&#8221; to get more detailed output. Don&#8217;t forget to restart Shibboleth after that.<\/p>\n<p><b>What&#8217;s Next<\/b><\/p>\n<p>I will discuss how to integrate Shibboleth SP with your IdP to control access to various resources.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Previous: SAML and shibboleth Next: Shibbleth: controlling access to resources Shibboleth is an open-source SAML implementation that is used for single sign-on. We are developing a SAML IdP, and I <a href=\"https:\/\/ikriv.com\/blog\/?p=2031\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[24],"tags":[],"class_list":["entry","author-ikriv","post-2031","post","type-post","status-publish","format-standard","category-saml"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2031"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2031\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}