ClientSecretCredential
in package
implements
TokenCredential
FinalYes
Authenticates a Microsoft Entra service principal with a client secret.
Table of Contents
Interfaces
- TokenCredential
- Defines how an Azure credential obtains access tokens.
Properties
- $clientId : string
- $clientSecret : string
- $options : ClientSecretCredentialOptions
- $tenantId : string
Methods
- __construct() : mixed
- getToken() : AccessToken
- Requests an access token for the supplied OAuth scopes.
Properties
$clientId read-only
private
string
$clientId
$clientSecret read-only
private
string
$clientSecret
$options read-only
private
ClientSecretCredentialOptions
$options
= new ClientSecretCredentialOptions()
$tenantId read-only
private
string
$tenantId
Methods
__construct()
public
__construct(string $tenantId, string $clientId, string $clientSecret[, ClientSecretCredentialOptions $options = new ClientSecretCredentialOptions() ]) : mixed
Parameters
- $tenantId : string
-
Microsoft Entra tenant ID.
- $clientId : string
-
Application (client) ID.
- $clientSecret : string
-
Application client secret.
- $options : ClientSecretCredentialOptions = new ClientSecretCredentialOptions()
getToken()
Requests an access token for the supplied OAuth scopes.
public
getToken(TokenRequestContext $context) : AccessToken
Parameters
- $context : TokenRequestContext