本文整理汇总了PHP中phpCAS::getProxies方法的典型用法代码示例。如果您正苦于以下问题:PHP phpCAS::getProxies方法的具体用法?PHP phpCAS::getProxies怎么用?PHP phpCAS::getProxies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpCAS
的用法示例。
在下文中一共展示了phpCAS::getProxies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PermissionDeniedException
* authentication fails.
*********************************************************/
// set debug mode
phpCAS::setDebug('/tmp/phpCAS_directory.log');
// initialize phpCAS
phpCAS::client(CAS_VERSION_2_0, CAS_HOST, CAS_PORT, CAS_PATH, false);
// no SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// force CAS authentication
phpCAS::forceAuthentication();
// If we are being proxied, limit the the attributes to those allowed to
// be passed to the proxying application. As defined in the CAS Protocol
// http://www.jasig.org/cas/protocol
// The first proxy listed is the most recent in the request chain. Limit
// to that services' allowed attributes.
$proxies = phpCAS::getProxies();
if (count($proxies)) {
$proxy = $proxies[0];
} else {
// If we not are allowing users to directly authenticate and use the service exit
if (!ALLOW_DIRECT_CAS_AUTHENTICATION) {
throw new PermissionDeniedException("Direct access to this service is not allowed.");
}
}
} else {
throw new PermissionDeniedException("No access key passed. Access denied.");
}
}
/*********************************************************
* Parse/validate our arguments and run the specified action.
*********************************************************/