{"id":1751072,"date":"2010-11-03T09:03:39","date_gmt":"2010-11-03T09:03:39","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-shibboleth-loop-wrong-key-checked\/"},"modified":"2016-08-19T20:19:38","modified_gmt":"2016-08-19T20:19:38","slug":"plugin-shibboleth-loop-wrong-key-checked","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-shibboleth-loop-wrong-key-checked\/","title":{"rendered":"[Plugin Shibboleth] loop wrong key checked"},"content":{"rendered":"<p>When trying to establish  if a session is active in shibboleth.php the function shibboleth_session_active is checking for session headers which in my environment don&#8217;t exist. <\/p>\n<p>Here is the function in question:<\/p>\n<pre><code>\/**\n * Check if a Shibboleth session is active.\n *\n * @return boolean if session is active\n * @uses apply_filters calls &#039;shibboleth_session_active&#039; before returning final result\n *\/\nfunction shibboleth_session_active() {\n        $active = false;\n\n        $session_headers = array(&#039;Shib-Session-ID&#039;, &#039;HTTP_SHIB_IDENTITY_PROVIDER&#039;);\n        foreach ($session_headers as $header) {\n                if ( array_key_exists($header, $_SERVER) &amp;&amp; !empty($_SERVER[$header]) ) {\n                        $active = true;\n                        break;\n                }\n        }\n\n        $active = apply_filters(&#039;shibboleth_session_active&#039;, $active);\n        return $active;\n}<\/code><\/pre>\n<p>I managed to get the plugin to work by changing the code to<\/p>\n<pre><code>\/**\n * Check if a Shibboleth session is active.\n *\n * @return boolean if session is active\n * @uses apply_filters calls &#039;shibboleth_session_active&#039; before returning final result\n *\/\nfunction shibboleth_session_active() {\n        $active = false;\n\n        $session_headers = array(&#039;Shib_Session_ID&#039;, &#039;HTTP_SHIB_IDENTITY_PROVIDER&#039;);\n        foreach ($session_headers as $header) {\n                if ( array_key_exists($header, $_SERVER) &amp;&amp; !empty($_SERVER[$header]) ) {\n                        $active = true;\n                        break;\n                }\n        }\n\n        $active = apply_filters(&#039;shibboleth_session_active&#039;, $active);\n        return $active;\n}<\/code><\/pre>\n<p>Without this change any attempt at using Shib would cauase a loop with the idp. Has anyone else seen this?<\/p>\n","protected":false},"template":"","class_list":["post-1751072","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1751072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1751072\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1751072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}