azure-identity
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Azure::Identity::ClientAssertionCredential Class Referencefinal

Credential which authenticates a Microsoft Entra service principal using a signed client assertion. More...

#include <client_assertion_credential.hpp>

Inheritance diagram for Azure::Identity::ClientAssertionCredential:

Public Member Functions

 ClientAssertionCredential (std::string tenantId, std::string clientId, std::function< std::string(Core::Context const &)> assertionCallback, ClientAssertionCredentialOptions const &options={})
 Creates an instance of the Client Assertion Credential with a callback that provides a signed client assertion to authenticate against Microsoft Entra ID.
 
 ~ClientAssertionCredential () override
 Destructs ClientAssertionCredential.
 
Core::Credentials::AccessToken GetToken (Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
 Obtains an authentication token from Microsoft Entra ID, by calling the assertionCallback specified when constructing the credential to obtain a client assertion for authentication.
 

Detailed Description

Constructor & Destructor Documentation

◆ ClientAssertionCredential()

ClientAssertionCredential::ClientAssertionCredential ( std::string  tenantId,
std::string  clientId,
std::function< std::string(Core::Context const &)>  assertionCallback,
ClientAssertionCredentialOptions const &  options = {} 
)
explicit
Parameters
tenantIdThe Microsoft Entra tenant (directory) ID of the service principal.
clientIdThe client (application) ID of the service principal.
assertionCallbackA callback returning a valid client assertion used to authenticate the service principal.
optionsOptions that allow to configure the management of the requests sent to Microsoft Entra ID for token retrieval.

◆ ~ClientAssertionCredential()

ClientAssertionCredential::~ClientAssertionCredential ( )
overridedefault

Member Function Documentation

◆ GetToken()

AccessToken ClientAssertionCredential::GetToken ( Core::Credentials::TokenRequestContext const &  tokenRequestContext,
Core::Context const &  context 
) const
override
Parameters
tokenRequestContextA context to get the token in.
contextA context to control the request lifetime.
Exceptions
Azure::Core::Credentials::AuthenticationExceptionAuthentication error occurred.

The documentation for this class was generated from the following files: