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


PHP Server::getTokenController方法代码示例

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


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

示例1: testGetTokenControllerAccessTokenStorageAndClientCredentialsStorageAndGrantTypes

 public function testGetTokenControllerAccessTokenStorageAndClientCredentialsStorageAndGrantTypes()
 {
     $server = new Server();
     $server->addStorage($this->getMock('OAuth2\\Storage\\AccessTokenInterface'));
     $server->addStorage($this->getMock('OAuth2\\Storage\\ClientCredentialsInterface'));
     $server->addGrantType($this->getMockBuilder('OAuth2\\GrantType\\AuthorizationCode')->disableOriginalConstructor()->getMock());
     $server->getTokenController();
 }
开发者ID:sarfraznawaz2005,项目名称:sso-examples,代码行数:8,代码来源:ServerTest.php

示例2: testUsingOpenIDConnectWithOpenIDAuthorizationCodeStorageCreatesOpenIDAuthorizationCodeGrantType

 public function testUsingOpenIDConnectWithOpenIDAuthorizationCodeStorageCreatesOpenIDAuthorizationCodeGrantType()
 {
     $client = $this->getMock('OAuth2\\Storage\\ClientCredentialsInterface');
     $userclaims = $this->getMock('OAuth2\\OpenID\\Storage\\UserClaimsInterface');
     $pubkey = $this->getMock('OAuth2\\Storage\\PublicKeyInterface');
     $token = $this->getMock('OAuth2\\Storage\\AccessTokenInterface');
     $authcode = $this->getMock('OAuth2\\OpenID\\Storage\\AuthorizationCodeInterface');
     $server = new Server(array($client, $userclaims, $pubkey, $token, $authcode), array('use_openid_connect' => true, 'issuer' => 'someguy'));
     $server->getTokenController();
     $this->assertInstanceOf('OAuth2\\OpenID\\GrantType\\AuthorizationCode', $server->getGrantType('authorization_code'));
 }
开发者ID:huangzhwork,项目名称:oauth2-server-php,代码行数:11,代码来源:ServerTest.php

示例3: testHttpBasicConfig

 public function testHttpBasicConfig()
 {
     // create mock storage
     $storage = Bootstrap::getInstance()->getMemoryStorage();
     $server = new Server(array($storage), array('allow_credentials_in_request_body' => false));
     $server->getTokenController();
     $httpBasic = $server->getClientAssertionType();
     $reflection = new \ReflectionClass($httpBasic);
     $prop = $reflection->getProperty('config');
     $prop->setAccessible(true);
     $config = $prop->getValue($httpBasic);
     // get the private "storages" property
     $this->assertEquals($config['allow_credentials_in_request_body'], false);
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:14,代码来源:ServerTest.php


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