/** * Process unsolicited requests * * @return EngineBlock_Saml2_AuthnRequestAnnotationDecorator */ protected function _createUnsolicitedRequest() { // Entity ID as requested in GET parameters $entityId = !empty($_GET['sp-entity-id']) ? $_GET['sp-entity-id'] : null; // Request optional acs-* parameters $acsLocation = !empty($_GET['acs-location']) ? $_GET['acs-location'] : null; $acsIndex = !empty($_GET['acs-index']) ? $_GET['acs-index'] : null; $binding = !empty($_GET['acs-binding']) ? $_GET['acs-binding'] : null; // Requested relay state $relayState = !empty($_GET['RelayState']) ? $_GET['RelayState'] : null; $sspRequest = new SAML2_AuthnRequest(); $sspRequest->setId($this->_server->getNewId(IdFrame::ID_USAGE_SAML2_REQUEST)); $sspRequest->setIssuer($entityId); $sspRequest->setRelayState($relayState); if ($acsLocation) { $sspRequest->setAssertionConsumerServiceURL($acsLocation); $sspRequest->setProtocolBinding($binding); } if ($acsIndex) { $sspRequest->setAssertionConsumerServiceIndex($acsIndex); } $request = new EngineBlock_Saml2_AuthnRequestAnnotationDecorator($sspRequest); $request->setUnsolicited(); return $request; }