AlexaClientSDK  1.19.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
 
- Public Member Functions inherited from alexaClientSDK::registrationManager::CustomerDataHandler
 CustomerDataHandler (std::shared_ptr< CustomerDataManager > customerDataManager)
 
virtual ~CustomerDataHandler ()
 

Static Public Member Functions

static std::unique_ptr< CBLAuthDelegatecreate (const avsCommon::utils::configuration::ConfigurationNode &configuration, std::shared_ptr< registrationManager::CustomerDataManager > 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/docs/alexa/alexa-voice-service/code-based-linking-other-platforms.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)
overridevirtual

Specify an object to observe changes to the authorization state of this AuthDelegate. During the call to this setter the observers onAuthStateChange() method will be called back with the current authorization state.

Parameters
observerThe object to observe this authorization state of this AuthDelegate.

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

◆ 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::CustomerDataHandler.

◆ create()

std::unique_ptr< CBLAuthDelegate > alexaClientSDK::authorization::cblAuthDelegate::CBLAuthDelegate::create ( const avsCommon::utils::configuration::ConfigurationNode configuration,
std::shared_ptr< registrationManager::CustomerDataManager 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.
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.

◆ 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)
overridevirtual

Remove an observer

Parameters
observerThe observer to remove.

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


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

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