Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client_credentials grant #179

Open
decomplexity opened this issue Mar 6, 2023 · 1 comment
Open

Client_credentials grant #179

decomplexity opened this issue Mar 6, 2023 · 1 comment

Comments

@decomplexity
Copy link

Does oauth2-azure support client_credentials grants pls?

@mxr576
Copy link

mxr576 commented Oct 28, 2024

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]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants