当前位置: 首页>>代码示例>>PHP>>正文


PHP phpCAS::allowProxyChain方法代码示例

本文整理汇总了PHP中phpCAS::allowProxyChain方法的典型用法代码示例。如果您正苦于以下问题:PHP phpCAS::allowProxyChain方法的具体用法?PHP phpCAS::allowProxyChain怎么用?PHP phpCAS::allowProxyChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpCAS的用法示例。


在下文中一共展示了phpCAS::allowProxyChain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CAS_ProxyChain

// reverse just as seen from the service. Proxies have to be defined in reverse
// from the service to the user. If a user hits service A and gets proxied via
// B to service C the list of acceptable on C would be array(B,A). The definition
// of an individual proxy can be either a string or a regexp (preg_match is used)
// that will be matched against the proxy list supplied by the cas server
// when validating the proxy tickets. The strings are compared starting from
// the beginning and must fully match with the proxies in the list.
// Example:
// 		phpCAS::allowProxyChain(new CAS_ProxyChain(array(
// 				'https://app.example.com/'
// 			)));
// 		phpCAS::allowProxyChain(new CAS_ProxyChain(array(
// 				'/^https:\/\/app[0-9]\.example\.com\/rest\//',
// 				'http://client.example.com/'
// 			)));
phpCAS::allowProxyChain(new CAS_ProxyChain(array($pgtUrlRegexp)));
// For quick testing or in certain production screnarios you might want to
// allow allow any other valid service to proxy your service. To do so, add
// the "Any" chain:
// 		phpcas::allowProxyChain(new CAS_ProxyChain_Any);
// THIS SETTING IS HOWEVER NOT RECOMMENDED FOR PRODUCTION AND HAS SECURITY
// IMPLICATIONS: YOU ARE ALLOWING ANY SERVICE TO ACT ON BEHALF OF A USER
// ON THIS SERVICE.
//phpcas::allowProxyChain(new CAS_ProxyChain_Any);
// force CAS authentication
phpCAS::forceAuthentication();
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
// moreover, a PGT was retrieved from the CAS server that will
// permit to gain accesses to new services.
?>
开发者ID:adamfranco,项目名称:phpcas-old-svn-tracking,代码行数:31,代码来源:example_service_that_proxies.php

示例2: CAS_ProxyChain

// from the service to the user. If a user hits service A and gets proxied via
// B to service C the list of acceptable on C would be array(B,A). The definition
// of an individual proxy can be either a string or a regexp (preg_match is used)
// that will be matched against the proxy list supplied by the cas server
// when validating the proxy tickets. The strings are compared starting from
// the beginning and must fully match with the proxies in the list.
// Example:
// 		phpCAS::allowProxyChain(new CAS_ProxyChain(array(
// 				'https://app.example.com/'
// 			)));
// 		phpCAS::allowProxyChain(new CAS_ProxyChain(array(
// 				'/^https:\/\/app[0-9]\.example\.com\/rest\//',
// 				'http://client.example.com/'
// 			)));
phpCAS::allowProxyChain(new CAS_ProxyChain(array($pgtUrlRegexp)));
phpCAS::allowProxyChain(new CAS_ProxyChain(array('/^' . $pgtBase . 'example_service_that_proxies.php$/', '/^' . $pgtBase . 'example_proxy_serviceWeb_chaining.php$/')));
// For quick testing or in certain production screnarios you might want to
// allow allow any other valid service to proxy your service. To do so, add
// the "Any" chain:
// 		phpcas::allowProxyChain(new CAS_ProxyChain_Any);
// THIS SETTING IS HOWEVER NOT RECOMMENDED FOR PRODUCTION AND HAS SECURITY
// IMPLICATIONS: YOU ARE ALLOWING ANY SERVICE TO ACT ON BEHALF OF A USER
// ON THIS SERVICE.
//phpcas::allowProxyChain(new CAS_ProxyChain_Any);
// force CAS authentication
phpCAS::forceAuthentication();
print '<h1>I am a service that can be proxied.</h1>';
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
require 'script_info.php';
// for this test, simply print that the authentication was successfull
开发者ID:dipeira,项目名称:sch-progs,代码行数:31,代码来源:example_service.php


注:本文中的phpCAS::allowProxyChain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。