azure-oss/identity

There is no license information available for the latest version (1.0.3) of this package.

Maintainers

Package info

github.com/php-oss-for-azure/azure-identity-php

pkg:composer/azure-oss/identity

Transparency log

Statistics

Installs: 648 923

Dependents: 2

Suggesters: 0

Stars: 2

1.0.3 2026-08-20 13:21 UTC

This package is auto-updated.

Last update: 2026-08-20 13:22:13 UTC


README

Latest Version on Packagist Packagist Downloads

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

  • ClientSecretCredential
  • ClientCertificateCredential
  • EnvironmentCredential
  • WorkloadIdentityCredential
  • ManagedIdentityCredential
  • ChainedTokenCredential
  • DefaultAzureCredential

Notes

  • DefaultAzureCredential tries a configurable credential chain for common Azure hosting environments.
  • By default, DefaultAzureCredential includes environment and workload identity credentials. Managed identity can be enabled through DefaultAzureCredentialOptions.
  • 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

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.