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

#include <LWAAuthorizationAdapter.h>

Inheritance diagram for alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter:
Collaboration graph
[legend]

Public Member Functions

 ~LWAAuthorizationAdapter ()
 Destructor. More...
 
LWAAuthorizationInterface
bool authorizeUsingCBL (const std::shared_ptr< acsdkAuthorizationInterfaces::lwa::CBLAuthorizationObserverInterface > &observer) override
 
bool authorizeUsingCBLWithCustomerProfile (const std::shared_ptr< acsdkAuthorizationInterfaces::lwa::CBLAuthorizationObserverInterface > &observer) override
 
AuthorizationInterface
std::string getId () override
 
AuthorizationAdapterInterface
std::string getAuthToken () override
 
void reset () override
 
void onAuthFailure (const std::string &authToken) override
 
avsCommon::sdkInterfaces::AuthObserverInterface::FullState getState () override
 
std::shared_ptr< acsdkAuthorizationInterfaces::AuthorizationInterfacegetAuthorizationInterface () override
 
avsCommon::sdkInterfaces::AuthObserverInterface::FullState onAuthorizationManagerReady (const std::shared_ptr< acsdkAuthorizationInterfaces::AuthorizationManagerInterface > &manager) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationInterface
virtual ~LWAAuthorizationInterface ()=default
 Destructor. More...
 
virtual bool authorizeUsingCBL (const std::shared_ptr< CBLAuthorizationObserverInterface > &observer)=0
 
virtual bool authorizeUsingCBLWithCustomerProfile (const std::shared_ptr< CBLAuthorizationObserverInterface > &observer)=0
 
- Public Member Functions inherited from alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationInterface
virtual ~AuthorizationInterface ()=default
 Destructor. More...
 
- Public Member Functions inherited from alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface
virtual ~AuthorizationAdapterInterface ()=default
 Destructor. More...
 
virtual avsCommon::sdkInterfaces::AuthObserverInterface::FullState onAuthorizationManagerReady (const std::shared_ptr< AuthorizationManagerInterface > &manager)=0
 

Static Public Member Functions

static std::shared_ptr< LWAAuthorizationAdaptercreate (const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configuration, std::unique_ptr< avsCommon::utils::libcurlUtils::HttpPostInterface > httpPost, const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo, const std::shared_ptr< acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface > &storage, std::unique_ptr< avsCommon::utils::libcurlUtils::HttpGetInterface > httpGet=nullptr, const std::string &adapterId="")
 

Detailed Description

This class provides functionality for the application to authorize using LWA methods.

The class does not currently support reauthorization. If authorization has occurred, then the application should call logout before authorizing.

Attention
It is the responsibility of the application to acquire the appropriate customer consent. Please refer to LWAAuthorizationInterface for more details.

Constructor & Destructor Documentation

◆ ~LWAAuthorizationAdapter()

alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::~LWAAuthorizationAdapter ( )

Destructor.

Member Function Documentation

◆ authorizeUsingCBL()

bool alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::authorizeUsingCBL ( const std::shared_ptr< acsdkAuthorizationInterfaces::lwa::CBLAuthorizationObserverInterface > &  observer)
override

◆ authorizeUsingCBLWithCustomerProfile()

bool alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::authorizeUsingCBLWithCustomerProfile ( const std::shared_ptr< acsdkAuthorizationInterfaces::lwa::CBLAuthorizationObserverInterface > &  observer)
override

◆ create()

static std::shared_ptr<LWAAuthorizationAdapter> alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::create ( const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &  configuration,
std::unique_ptr< avsCommon::utils::libcurlUtils::HttpPostInterface httpPost,
const std::shared_ptr< avsCommon::utils::DeviceInfo > &  deviceInfo,
const std::shared_ptr< acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface > &  storage,
std::unique_ptr< avsCommon::utils::libcurlUtils::HttpGetInterface httpGet = nullptr,
const std::string &  adapterId = "" 
)
static

Creates an instance of LWAAuthorizationAdapter.

Parameters
configurationThe configuration node.
httpPostAn object for making HTTPPost requests.
deviceInfoDevice info.
storagePersisted storage.
httpGetAn object for making HTTPGet requests.
adapterIdAllows for specifying an alternate adapterId to the default.
Returns
An instance if successful or null.

◆ getAuthorizationInterface()

std::shared_ptr<acsdkAuthorizationInterfaces::AuthorizationInterface> alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::getAuthorizationInterface ( )
overridevirtual

Returns the associated application facing AuthorizationInterface. This must never return null, as it is used by AuthorizationManagerInterface to further retrieve the unique identifier for the AuthorizationAdapterInterface instance.

Returns
The AuthorizationInterface instance.

Implements alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface.

◆ getAuthToken()

std::string alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::getAuthToken ( )
overridevirtual

Returns the auth token if authorized, otherwise returns an empty string.

Returns
The auth token or an empty string.

Implements alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface.

◆ getId()

std::string alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::getId ( )
overridevirtual

Returns a unique identifier used to identify this adapter.

Returns
The id.

Implements alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationInterface.

◆ getState()

avsCommon::sdkInterfaces::AuthObserverInterface::FullState alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::getState ( )
overridevirtual

Returns the current state of the AuthorizationAdapterInterface.

Returns
The state.

Implements alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface.

◆ onAuthFailure()

void alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::onAuthFailure ( const std::string &  authToken)
overridevirtual

Indicates if the authToken returned in AuthorizationAdapterInterface::getAuthToken() is invalid. If the adapter is authorized, this should cause a reportStateChange() call (please refer to function documentation for further details), and attempt to obtain a valid access token.

If the adapter is not authorized, this call should be ignored.

Implements alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface.

◆ onAuthorizationManagerReady()

avsCommon::sdkInterfaces::AuthObserverInterface::FullState alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::onAuthorizationManagerReady ( const std::shared_ptr< acsdkAuthorizationInterfaces::AuthorizationManagerInterface > &  manager)
override

◆ reset()

void alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter::reset ( )
overridevirtual

Logs out and clears the data within this adapter. This should not initiate a device wide deregistration, that will be handled by the AuthorizationOrchestratorInterface. If this is called, the adapter must stop any ongoing authorization.

Implements alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface.


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