azure-core
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Azure::Core::Credentials::TokenCredential Class Referenceabstract

A base type of credential that uses Azure::Core::AccessToken to authenticate requests.

#include <credentials.hpp>

Public Member Functions

virtual AZ_CORE_DLLEXPORT AccessToken GetToken (TokenRequestContext const &tokenRequestContext, Context const &context) const =0
 Gets an authentication token.
 
std::string const & GetCredentialName () const
 Gets the name of the credential.
 
virtual AZ_CORE_DLLEXPORT ~TokenCredential ()=default
 Destructs TokenCredential.
 

Protected Member Functions

 TokenCredential (std::string const &credentialName)
 Constructs an instance of TokenCredential.
 
 TokenCredential ()
 Constructs a default instance of TokenCredential.
 

Constructor & Destructor Documentation

◆ ~TokenCredential()

virtual AZ_CORE_DLLEXPORT Azure::Core::Credentials::TokenCredential::~TokenCredential ( )
virtualdefault

◆ TokenCredential() [1/2]

Azure::Core::Credentials::TokenCredential::TokenCredential ( std::string const &  credentialName)
inlineprotected
Parameters
credentialNameName of the credential for diagnostic messages.

◆ TokenCredential() [2/2]

Azure::Core::Credentials::TokenCredential::TokenCredential ( )
inlineprotected
Deprecated:
Use the constructor with parameter.

Member Function Documentation

◆ GetCredentialName()

std::string const & Azure::Core::Credentials::TokenCredential::GetCredentialName ( ) const
inline

◆ GetToken()

virtual AZ_CORE_DLLEXPORT AccessToken Azure::Core::Credentials::TokenCredential::GetToken ( TokenRequestContext const &  tokenRequestContext,
Context const &  context 
) const
pure virtual
Parameters
tokenRequestContextA context to get the token in.
contextA context to control the request lifetime.
Returns
Authentication token.
Exceptions
Azure::Core::Credentials::AuthenticationExceptionAuthentication error occurred.

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