本文整理匯總了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.
*********************************************************/