本文整理汇总了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();
}
示例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'));
}
示例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);
}