steinbauerit/azure-auth-php-client
最新稳定版本:1.0.0
Composer 安装命令:
composer require steinbauerit/azure-auth-php-client
包简介
PHP client for azure authentication
README 文档
README
PHP client for azure authentication
Installation
Just run
composer require steinbauerit/azure-auth-php-client
Usage
try {
$clientId = 'clientId';
$clientSecret = 'secret';
$authorizationCode = 'authCode';
$tenantId = 'common';
$redirectUri = 'http://localhost';
// The auth provider will only authorize requests to
// the allowed hosts, in this case Microsoft Graph
$allowedHosts = ['graph.microsoft.com'];
$scopes = ['User.Read'];
$tokenRequestContext = new AuthorizationCodeContext(
$tenantId,
$clientId,
$clientSecret,
$authorizationCode,
$redirectUri
);
$authProvider = new PhpLeagueAuthenticationProvider($tokenRequestContext, $scopes, $allowedHosts);
$requestAdapter = new GuzzleRequestAdapter($authProvider);
$client = new GraphApiClient($requestAdapter);
$me = $client->me()->get()->wait();
echo "Hello {$me->getDisplayName()}, your ID is {$me->getId()}";
} catch (ApiException $ex) {
echo $ex->getMessage();
}
Author
统计信息
- 总下载量: 143
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-08-01