oauth2-azure
oauth2-azure copied to clipboard
Client_credentials grant
Does oauth2-azure support client_credentials grants pls?
Yes, it does, I mean the underlying league/oauth2-client library supports that.
$provider = new TheNetworg\OAuth2\Client\Provider\Azure([
'tenant' => $tenantId,
'clientId' => $clientId,
// 'client_secret' => $clientSecret,
'scope' => 'https://management.azure.com/.default',
]);
$provider->defaultEndPointVersion = $provider::ENDPOINT_VERSION_2_0;
$accessToken = $provider->getAccessToken('client_credentials', ['scope' => $provider->scope, 'client_secret' => $clientSecret]);