#include <AuthDelegateInterface.h>
The AuthDelegateInterface is used to provide clients with valid LWA authorization tokens.
- See also
- https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/content/avs-api-overview#authorization Given an
AuthDelegateInterface
pointer, the client is expected to call getAuthToken()
immediately before making AVS requests. The returned value is passed in the HTTP/2 header of requests sent to AVS. These authorization tokens may expire, so AuthDelegates also track the state of authorization (essentially, whether an immediate call to getAuthToken()
will return a token that is expected to be viable). The client may elect to receive callbacks when this state changes by calling setAuthObserver()
. This allows the client to avoid sending requests tha are doomed to fail because the authorization token has already expired. This also allows the client to know when authorization has been restored.
◆ ~AuthDelegateInterface()
virtual alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface::~AuthDelegateInterface |
( |
| ) |
|
|
virtualdefault |
Virtual destructor to assure proper cleanup of derived types.
◆ addAuthObserver()
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
-
observer | The object to observe this authorization state of this AuthDelegate. |
◆ getAuthToken()
virtual std::string alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface::getAuthToken |
( |
| ) |
|
|
pure virtual |
◆ onAuthFailure()
virtual void alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface::onAuthFailure |
( |
const std::string & |
token | ) |
|
|
pure virtual |
◆ removeAuthObserver()
Remove an observer
- Parameters
-
observer | The observer to remove. |
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