public function testNameIDFormatIsSetFromRemoteMetaData() { $proxyServer = $this->factoryProxyServer(); $originalRequest = $this->factoryOriginalRequest(); $identityProvider = $proxyServer->getRepository()->fetchIdentityProviderByEntityId('testIdp'); $identityProvider->nameIdFormat = 'fooFormat'; /** @var SAML2_AuthnRequest $enhancedRequest */ $enhancedRequest = EngineBlock_Saml2_AuthnRequestFactory::createFromRequest($originalRequest, $identityProvider, $proxyServer); $nameIdPolicy = $enhancedRequest->getNameIdPolicy(); $this->assertEquals($nameIdPolicy['Format'], 'fooFormat'); }
public function sendAuthenticationRequest(EngineBlock_Saml2_AuthnRequestAnnotationDecorator $spRequest, $idpEntityId) { $cookieExpiresStamp = null; if (isset($this->_configs['rememberIdp'])) { $cookieExpiresStamp = strtotime($this->_configs['rememberIdp']); } $this->setCookie('selectedIdp', $idpEntityId, $cookieExpiresStamp); $originalId = $spRequest->getId(); $identityProvider = $this->getRepository()->fetchIdentityProviderByEntityId($idpEntityId); $ebRequest = EngineBlock_Saml2_AuthnRequestFactory::createFromRequest($spRequest, $identityProvider, $this); $newId = $ebRequest->getId(); // Store the original Request $authnRequestRepository = new EngineBlock_Saml2_AuthnRequestSessionRepository($this->_sessionLog); $authnRequestRepository->store($spRequest); $authnRequestRepository->link($ebRequest, $spRequest); $this->getBindingsModule()->send($ebRequest, $identityProvider); }