當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。