AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate Class Reference

#include <CBLAuthDelegate.h>

Inheritance diagram for alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate:
Collaboration graph
[legend]

Public Member Functions

 CBLAuthDelegate (const CBLAuthDelegate &rhs)=delete
 
 ~CBLAuthDelegate ()
 
CBLAuthDelegateoperator= (const CBLAuthDelegate &rhs)=delete
 
AuthDelegateInterface methods
void addAuthObserver (std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface > observer) override
 
void removeAuthObserver (std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface > observer) override
 
std::string getAuthToken () override
 
void onAuthFailure (const std::string &token) override
 
CustomerDataHandler methods
void clearData () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface
virtual ~AuthDelegateInterface ()=default
 
virtual void addAuthObserver (std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface > observer)=0
 
virtual void removeAuthObserver (std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface > observer)=0
 
- Public Member Functions inherited from alexaClientSDK::registrationManager::CustomerDataHandler
 CustomerDataHandler (const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &dataManager)
 
virtual ~CustomerDataHandler ()
 
- Public Member Functions inherited from alexaClientSDK::registrationManager::CustomerDataHandlerInterface
virtual ~CustomerDataHandlerInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< AuthDelegateInterface > createAuthDelegateInterface (const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configuration, const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &customerDataManager, const std::shared_ptr< CBLAuthDelegateStorageInterface > &storage, const std::shared_ptr< CBLAuthRequesterInterface > &authRequester, std::unique_ptr< avsCommon::utils::libcurlUtils::HttpPostInterface > httpPost, const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo)
 
static std::unique_ptr< CBLAuthDelegatecreate (const avsCommon::utils::configuration::ConfigurationNode &configuration, std::shared_ptr< registrationManager::CustomerDataManagerInterface > customerDataManager, std::shared_ptr< CBLAuthDelegateStorageInterface > storage, std::shared_ptr< CBLAuthRequesterInterface > authRequester, std::shared_ptr< avsCommon::utils::libcurlUtils::HttpPostInterface > httpPost=nullptr, std::shared_ptr< avsCommon::utils::DeviceInfo > deviceInfo=nullptr)
 

Detailed Description

CBLAuthDelegate provides an implementation of the AuthDelegateInterface using the Code-Based Linking authorization process.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/authorize-cbl.html

Constructor & Destructor Documentation

◆ CBLAuthDelegate()

alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::CBLAuthDelegate ( const CBLAuthDelegate rhs)
delete

Deleted copy constructor

Parameters
rhsThe 'right hand side' to not copy.

◆ ~CBLAuthDelegate()

alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::~CBLAuthDelegate ( )

Destructor

Member Function Documentation

◆ addAuthObserver()

void alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::addAuthObserver ( std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface observer)
override

◆ clearData()

void alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::clearData ( )
overridevirtual

Reset any internal state that may be associated with a particular user.

Warning
Object must succeed in deleting any customer data.
This method is called while CustomerDataManager is in a locked state. Do not call or wait for any CustomerDataManager operation.

Implements alexaClientSDK::registrationManager::CustomerDataHandlerInterface.

◆ create()

static std::unique_ptr<CBLAuthDelegate> alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::create ( const avsCommon::utils::configuration::ConfigurationNode configuration,
std::shared_ptr< registrationManager::CustomerDataManagerInterface customerDataManager,
std::shared_ptr< CBLAuthDelegateStorageInterface >  storage,
std::shared_ptr< CBLAuthRequesterInterface >  authRequester,
std::shared_ptr< avsCommon::utils::libcurlUtils::HttpPostInterface httpPost = nullptr,
std::shared_ptr< avsCommon::utils::DeviceInfo deviceInfo = nullptr 
)
static

Create a CBLAuthDelegate. This function cannot be called if:

  • AlexaClientSDKInit::initialize has not been called yet.
  • After AlexaClientSDKInit::un-initialize has been called.
Deprecated:
Parameters
configurationThe ConfigurationNode containing the configuration parameters for the new instance.
customerDataManagerThe CustomerDataManager instance this instance should register with.
storageThe object used to persist the new CBLAuthDelegate's state.
authRequesterObserver used to tell the user to browse to a URL and enter a 'user code'.
httpPostInstance that implements HttpPostInterface. If nullptr, a default implementation.
deviceInfoThe deviceInfo instance. will be provided.
Returns
A new instance of CBLAuthDelegate.

◆ createAuthDelegateInterface()

static std::shared_ptr<AuthDelegateInterface> alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::createAuthDelegateInterface ( const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &  configuration,
const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &  customerDataManager,
const std::shared_ptr< CBLAuthDelegateStorageInterface > &  storage,
const std::shared_ptr< CBLAuthRequesterInterface > &  authRequester,
std::unique_ptr< avsCommon::utils::libcurlUtils::HttpPostInterface httpPost,
const std::shared_ptr< avsCommon::utils::DeviceInfo > &  deviceInfo 
)
static

Create an instance of AuthDelegateInterface This function cannot be called if:

  • AlexaClientSDKInit::initialize has not been called yet.
  • After AlexaClientSDKInit::un-initialize has been called.
Parameters
configurationThe ConfigurationNode containing the configuration parameters for the new instance.
customerDataManagerThe CustomerDataManager instance this instance should register with.
storageThe object used to persist the new CBLAuthDelegate's state.
authRequesterObserver used to tell the user to browse to a URL and enter a 'user code'.
httpPostInstance that implements HttpPostInterface. If nullptr, a default implementation.
deviceInfoThe deviceInfo instance. will be provided.
Returns
A new instance of CBLAuthDelegate.

◆ getAuthToken()

std::string alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::getAuthToken ( )
overridevirtual

Get the current LWA authorization token.

Returns
The current authorization token. The returned value will be empty if an authorization token has yet to be acquired or if the most recently acquired token has expired.

Implements alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface.

◆ onAuthFailure()

void alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::onAuthFailure ( const std::string &  token)
overridevirtual

Receive notification that an operation using the specified auth token experienced an authorization failure.

Parameters
tokenThe token used to authorize the forbidden operation.

Implements alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface.

◆ operator=()

CBLAuthDelegate& alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::operator= ( const CBLAuthDelegate rhs)
delete

Deleted assignment operator

Parameters
rhsThe 'right hand side' to not copy.

◆ removeAuthObserver()

void alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::removeAuthObserver ( std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface observer)
override

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0