azure-oss / identity
There is no license information available for the latest version (1.0.3) of this package.
1.0.3
2026-08-20 13:21 UTC
Requires
- php: ^8.1
- ext-openssl: *
- php-http/discovery: ^1.20
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^2.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.10 || ^8.0
- laravel/pint: ^1.27
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^13.0
Suggests
- guzzlehttp/guzzle: Provides a PSR-18 HTTP client and PSR-17 factories (used by default when installed).
README
A PHP identity library for acquiring Microsoft Entra ID access tokens with client secret, client certificate, workload identity, managed identity, and default credential flows.
Important
This package is community-maintained and is not affiliated with, endorsed by, or supported by Microsoft.
Install
composer require azure-oss/identity
Quickstart
<?php use AzureOss\Identity\ClientSecretCredential; use AzureOss\Identity\TokenRequestContext; $credential = new ClientSecretCredential( tenantId: getenv('AZURE_TENANT_ID'), clientId: getenv('AZURE_CLIENT_ID'), clientSecret: getenv('AZURE_CLIENT_SECRET'), ); $token = $credential->getToken( new TokenRequestContext(['https://storage.azure.com/.default']) ); echo $token->token;
Credentials
ClientSecretCredentialClientCertificateCredentialEnvironmentCredentialWorkloadIdentityCredentialManagedIdentityCredentialChainedTokenCredentialDefaultAzureCredential
Notes
DefaultAzureCredentialtries a configurable credential chain for common Azure hosting environments.- By default,
DefaultAzureCredentialincludes environment and workload identity credentials. Managed identity can be enabled throughDefaultAzureCredentialOptions. - The package depends on PSR-18 and PSR-17 interfaces and will use discovered implementations when available.
Documentation
You can read the documentation here.
Related packages
- azure-oss/storage — Meta package for the Storage SDKs
- azure-oss/storage-common — Shared authentication, HTTP, and SAS primitives for Storage SDKs
- azure-oss/storage-blob — Blob Storage SDK
- azure-oss/storage-blob-flysystem — Flysystem adapter
- azure-oss/storage-blob-flysystem-bundle — Symfony Flysystem bundle
- azure-oss/storage-blob-laravel — Laravel filesystem driver
- azure-oss/storage-queue — Queue Storage SDK
- azure-oss/storage-queue-laravel — Laravel queue connector
- azure-oss/storage-file-share — File Share SDK
Maintenance
This package is part of the community-maintained PHP OSS for Azure project. It is an independent project and is not affiliated with or endorsed by Microsoft.
License
This project is released under the MIT License. See LICENSE for details.