Skip to content

AzureTokenProviderFactory

Builds a bare AzureTokenProvider for whichever auth a config value asks for, scoped to an arbitrary AAD resource — not only storage.

AzureCredentialFactory is the storage-flavoured caller (it wraps the result in a BearerCredential); a caller authenticating against a different AAD-protected API (Log Analytics, another Azure REST surface) resolves its own AzureTokenProvider straight from here instead.

shared_key is deliberately not one of the strategies this factory knows: it is a request-signing scheme tied to a storage account key, not a bearer token, and has no meaning for an API that only accepts Azure AD tokens.

final class AzureTokenProviderFactory

SourceAzureTokenProviderFactory.php
MethodDescription
fromConfig(array<string, string> $config, ClientInterface $httpClient, string $resource = Quiote\Storage\Azure\AzureTokenProvider::STORAGE_RESOURCE, Psr17Factory $psr17 = new Psr17Factory(…), LoggerInterface $logger = new NullLogger(…)): AzureTokenProvider

public static function fromConfig(array<string, string> $config, ClientInterface $httpClient, string $resource = Quiote\Storage\Azure\AzureTokenProvider::STORAGE_RESOURCE, Psr17Factory $psr17 = new Psr17Factory(…), LoggerInterface $logger = new NullLogger(…)): AzureTokenProvider

PSR-3, so a Quiote application can pass its own Quiote\Logging\Log::for(...) without this package needing the framework as a dependency. Defaults to discarding everything.

ParameterTypeDescription
$configarray``<``string``, ``string``>Keys: auth (workload_identity | cli | chain).
$httpClientClientInterface
$resourcestringThe az account get-access-token --resource form: an https URL ending in /. The client-credentials scope used for workload_identity/chain is derived from this by appending .default, per AzureTokenProvider’s own docblock.
$psr17Psr17Factory
$loggerLoggerInterfacePSR-3, so a Quiote application can pass its own Quiote\Logging\Log::for(...) without this package needing the framework as a dependency. Defaults to discarding everything.

Returns AzureTokenProvider