Skip to content

BearerCredential

Azure AD authentication: every request carries Authorization: Bearer {token}, the token itself coming from an AzureTokenProvider (workload identity, the Azure CLI, or a chain of both).

No storage account key is ever read or needed.

final class BearerCredential implements AzureCredential

ImplementsAzureCredential
SourceBearerCredential.php

public function __construct(AzureTokenProvider $tokenProvider): mixed

ParameterTypeDescription
$tokenProviderAzureTokenProvider

Returns mixed

MethodDescription
authorizationHeader(string $accountName, string $method, string $path, array<string, string> $query, array<string, string> $headers): string

public function authorizationHeader(string $accountName, string $method, string $path, array<string, string> $query, array<string, string> $headers): string

The request’s headers, including x-ms-date and x-ms-version, before Authorization is added.

ParameterTypeDescription
$accountNamestring
$methodstring
$pathstring
$queryarray``<``string``, ``string``>Signed as part of the canonicalized resource.
$headersarray``<``string``, ``string``>The request’s headers, including x-ms-date and x-ms-version, before Authorization is added.

Returns string