本文整理汇总了PHP中SimpleSAML_Utilities::getDefaultEndpoint方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Utilities::getDefaultEndpoint方法的具体用法?PHP SimpleSAML_Utilities::getDefaultEndpoint怎么用?PHP SimpleSAML_Utilities::getDefaultEndpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_Utilities
的用法示例。
在下文中一共展示了SimpleSAML_Utilities::getDefaultEndpoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
#$statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php');
$session = SimpleSAML_Session::getInstance();
#$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
SimpleSAML_Logger::debug('ajax-verify.php called');
$result = array();
try {
$xmldata = $_REQUEST['xmlmetadata'];
$initurl = $_REQUEST['initurl'];
$initslo = $_REQUEST['initslo'];
SimpleSAML_Utilities::validateXMLDocument($xmldata, 'saml-meta');
$entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsString($xmldata);
$entity = array_pop($entities);
$metadata = $entity->getMetadata20SP();
/* Trim metadata endpoint arrays. */
$metadata['AssertionConsumerService'] = array(SimpleSAML_Utilities::getDefaultEndpoint($metadata['AssertionConsumerService'], array(SAML2_Const::BINDING_HTTP_POST)));
$metadata['SingleLogoutService'] = array(SimpleSAML_Utilities::getDefaultEndpoint($metadata['SingleLogoutService'], array(SAML2_Const::BINDING_HTTP_REDIRECT)));
$idpentityid = SimpleSAML_Utilities::getBaseURL() . 'module.php/fedlab';
$idpmetadata = array('entityid' => $idpentityid, 'certificate' => 'server.crt', 'privatekey' => 'server.pem');
$testconfig = array('sspmod_fedlab_BasicSPTest', 'sspmod_fedlab_AuthnRequestVerify', 'sspmod_fedlab_ExtendedSPTest', 'sspmod_fedlab_tests_CheckRequestID', 'sspmod_fedlab_tests_Metadata', 'sspmod_fedlab_tests_Replay', 'sspmod_fedlab_tests_MultipleAttr', 'sspmod_fedlab_tests_TrickySignature', 'sspmod_fedlab_tests_TrickySignature2', 'sspmod_fedlab_tests_MultipleAssertions', 'sspmod_fedlab_tests_SLOTest', 'sspmod_fedlab_tests_IdPInitSLOTest', 'sspmod_fedlab_tests_IdPInitSLONoCookie');
$testprogramme = new sspmod_fedlab_TestProgramme($testconfig, $idpmetadata, $metadata, $xmldata, $initurl, $initslo);
$session->setData('fedlab', 'testprogramme', $testprogramme);
$test = new sspmod_fedlab_BasicSPTest($idpmetadata, $metadata, $entity, $initurl, $initslo);
error_log('before test3');
$test->simpleTest();
error_log('after test');
$result = array('status' => 'success');
} catch (Exception $e) {
error_log('exception');
$result = array('status' => 'error', 'message' => $e->getMessage());
}
/*
示例2: getDefaultEndpoint
/**
* Find the default endpoint of the given type.
*
* @param string $endpointType The endpoint type.
* @param array $bindings Array with acceptable bindings. Can be NULL if any binding is allowed.
* @param mixed $default The default value to return if no matching endpoint is found. If no default is provided, an exception will be thrown.
* @return array|NULL The default endpoint, or NULL if no acceptable endpoints are used.
*/
public function getDefaultEndpoint($endpointType, array $bindings = NULL, $default = self::REQUIRED_OPTION)
{
assert('is_string($endpointType)');
$endpoints = $this->getEndpoints($endpointType);
$defaultEndpoint = SimpleSAML_Utilities::getDefaultEndpoint($endpoints, $bindings);
if ($defaultEndpoint !== NULL) {
return $defaultEndpoint;
}
if ($default === self::REQUIRED_OPTION) {
$loc = $this->location . '[' . var_export($endpointType, TRUE) . ']:';
throw new Exception($loc . 'Could not find a supported ' . $endpointType . ' endpoint.');
}
return $default;
}
示例3: getACS
public function getACS()
{
return SimpleSAML_Utilities::getDefaultEndpoint($this->parsed['AssertionConsumerService'], array(SAML2_Const::BINDING_HTTP_POST));
}