Alexa Auto SDK  2.0.0
Public Types | Public Member Functions | List of all members
aace::cbl::CBL Class Referenceabstract

Public Types

enum  CBLState {
  CBLState::STARTING,
  CBLState::REQUESTING_CODE_PAIR,
  CBLState::CODE_PAIR_RECEIVED,
  CBLState::REFRESHING_TOKEN,
  CBLState::REQUESTING_TOKEN,
  CBLState::STOPPING
}
 
enum  CBLStateChangedReason {
  CBLStateChangedReason::SUCCESS,
  CBLStateChangedReason::ERROR,
  CBLStateChangedReason::TIMEOUT,
  CBLStateChangedReason::CODE_PAIR_EXPIRED,
  CBLStateChangedReason::NONE
}
 

Public Member Functions

virtual void cblStateChanged (CBLState state, CBLStateChangedReason reason, const std::string &url, const std::string &code)=0
 
virtual void clearRefreshToken ()=0
 
virtual void setRefreshToken (const std::string &refreshToken)=0
 
virtual std::string getRefreshToken ()=0
 
virtual void setUserProfile (const std::string &name, const std::string &email)=0
 
void start ()
 
void cancel ()
 
void reset ()
 

Detailed Description

CBL should be extended to perform CBL authentication

Member Enumeration Documentation

◆ CBLState

Specifies the state of the authorization flow

Enumerator
STARTING 

CBL process is starting

REQUESTING_CODE_PAIR 

Initiating the process to request a code pair

CODE_PAIR_RECEIVED 

Code pair is received and is waiting on user to authenticate

REFRESHING_TOKEN 

Refreshing token stage has begun

REQUESTING_TOKEN 

Requesting for authorization token

STOPPING 

CBL process is ending

◆ CBLStateChangedReason

Specifies the reason for the state change

Enumerator
SUCCESS 

The CBL state changed successfully

ERROR 

Error occured in the CBL process

TIMEOUT 

Request timed out

CODE_PAIR_EXPIRED 

Code pair has expired and user will need to initiate the authentication process again

NONE 

No reason specified

Member Function Documentation

◆ cblStateChanged()

virtual void aace::cbl::CBL::cblStateChanged ( CBLState  state,
CBLStateChangedReason  reason,
const std::string &  url,
const std::string &  code 
)
pure virtual

Notifies the platform implementation of an authorization flow state change

◆ clearRefreshToken()

virtual void aace::cbl::CBL::clearRefreshToken ( )
pure virtual

Notifies the platform implementation to clear the refresh token

◆ setRefreshToken()

virtual void aace::cbl::CBL::setRefreshToken ( const std::string &  refreshToken)
pure virtual

Notifies the platform implemnentation to set the refresh token

◆ getRefreshToken()

virtual std::string aace::cbl::CBL::getRefreshToken ( )
pure virtual

Returns the refresh token stored by the platform implementation, otherwise return an empty string

◆ setUserProfile()

virtual void aace::cbl::CBL::setUserProfile ( const std::string &  name,
const std::string &  email 
)
pure virtual

Notifies the platform implementation to set the user profile requestUserProfile must be enabled in configuration

◆ start()

void aace::cbl::CBL::start ( )

Notifies the Engine to begin the authorization process

◆ cancel()

void aace::cbl::CBL::cancel ( )

Notifies the Engine to cancel the authorization process

◆ reset()

void aace::cbl::CBL::reset ( )

Notifies the Engine to reset the authorization state


Alexa Auto SDK 2.0.0 - Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0