diff --git a/docs/source/simplesamlphp-sp.xml b/docs/source/simplesamlphp-sp.xml index ee67158c6d34da82c527d026389f9aa76df4ab04..7e2f8c03862fef14397af3827f6d4455cf8d705d 100644 --- a/docs/source/simplesamlphp-sp.xml +++ b/docs/source/simplesamlphp-sp.xml @@ -247,6 +247,15 @@ set, the SP receives all attributes available at the IdP.</para> </glossdef> </glossentry> + + <glossentry> + <glossterm>IsPassive</glossterm> + + <glossdef> + <para>IsPassive allows you to enable passive authentication by + default for this SP.</para> + </glossdef> + </glossentry> </glosslist> </section> diff --git a/lib/SimpleSAML/XML/SAML20/AuthnRequest.php b/lib/SimpleSAML/XML/SAML20/AuthnRequest.php index bf591eeb4dbfeaf6142e8481a5f22dac728504ce..b3e5fb1134c84bf2909b919afb3eb2699976aa8d 100644 --- a/lib/SimpleSAML/XML/SAML20/AuthnRequest.php +++ b/lib/SimpleSAML/XML/SAML20/AuthnRequest.php @@ -20,7 +20,7 @@ class SimpleSAML_XML_SAML20_AuthnRequest { private $message = null; private $dom; private $relayState = null; - private $isPassive = 'false'; + private $isPassive = null; const PROTOCOL = 'saml2'; @@ -234,6 +234,25 @@ class SimpleSAML_XML_SAML20_AuthnRequest { </samlp:RequestedAuthnContext>'; } + + /* Check the metadata for isPassive if $this->isPassive === NULL. */ + if($this->isPassive === NULL) { + /* + * Process the SAML 2.0 SP hosted metadata parameter: IsPassive + */ + if (isset($md['IsPassive'])) { + if (is_bool($md['IsPassive'])) { + $this->isPassive = ($md['IsPassive'] ? 'true' : 'false'); + } else { + throw new Exception('Illegal format of the IsPassive parameter in' . + ' the SAML 2.0 SP hosted metadata for entity [' . $spentityid . + ']. This value should be set to a PHP boolean value.'); + } + } else { + /* The default is off. */ + $this->isPassive = 'false'; + } + } /*