AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface Class Referenceabstract

#include <AuthorizationAdapterInterface.h>

Inheritance diagram for alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~AuthorizationAdapterInterface ()=default
 Destructor. More...
 
virtual std::string getAuthToken ()=0
 
virtual void reset ()=0
 
virtual void onAuthFailure (const std::string &authToken)=0
 
virtual avsCommon::sdkInterfaces::AuthObserverInterface::FullState getState ()=0
 
virtual std::shared_ptr< AuthorizationInterfacegetAuthorizationInterface ()=0
 
virtual avsCommon::sdkInterfaces::AuthObserverInterface::FullState onAuthorizationManagerReady (const std::shared_ptr< AuthorizationManagerInterface > &manager)=0
 

Detailed Description

The AuthorizationAdapterInterface is an abstraction for an authorization mechanism. This interface will be used for the AuthorizationManagerInterface to communicate. The application will not need to call these methods directly. The class provides methods to query the current state and token information. Additionally, control methods are provided to instruct the object when to reset().

The other side of this communication happens using the AuthorizationManagerInterface::reportStateChange() method. Once the manager is ready to receive messages, expect the AuthorizationManagerInterface::onManagerReady() callback. This will pass an instance of the manager that is to be used for further interactions.

Constructor & Destructor Documentation

◆ ~AuthorizationAdapterInterface()

virtual alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface::~AuthorizationAdapterInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getAuthorizationInterface()

virtual std::shared_ptr<AuthorizationInterface> alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface::getAuthorizationInterface ( )
pure virtual

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.

Implemented in alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter.

◆ getAuthToken()

virtual std::string alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface::getAuthToken ( )
pure virtual

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

Returns
The auth token or an empty string.

Implemented in alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter.

◆ getState()

virtual avsCommon::sdkInterfaces::AuthObserverInterface::FullState alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface::getState ( )
pure virtual

Returns the current state of the AuthorizationAdapterInterface.

Returns
The state.

Implemented in alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter.

◆ onAuthFailure()

virtual void alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface::onAuthFailure ( const std::string &  authToken)
pure virtual

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.

Implemented in alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter.

◆ onAuthorizationManagerReady()

virtual avsCommon::sdkInterfaces::AuthObserverInterface::FullState alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface::onAuthorizationManagerReady ( const std::shared_ptr< AuthorizationManagerInterface > &  manager)
pure virtual

Sets the AuthorizationManagerInterface and communicates to the adapter the manager is now ready to receive messages. Adapters must ensure that no AuthorizationManagerInterface calls are made in this callback as the implementation makes no guarantee about re-entrancy.

Parameters
AuthorizationManagerInterfacemanager
Returns
The current state of the adapter.

◆ reset()

virtual void alexaClientSDK::acsdkAuthorizationInterfaces::AuthorizationAdapterInterface::reset ( )
pure virtual

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.

Implemented in alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationAdapter.


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