Alexa Auto SDK  3.2.0
Classes | Public Member Functions | Protected Member Functions | List of all members
com.amazon.aace.authorization.Authorization Class Referenceabstract

Classes

enum  AuthorizationState
 

Public Member Functions

void eventReceived (String service, String event)
 
void authorizationStateChanged (String service, AuthorizationState state)
 
void authorizationError (String service, String error, String message)
 
String getAuthorizationData (String service, String key)
 
void setAuthorizationData (String service, String key, String data)
 

Protected Member Functions

final void startAuthorization (String service, String data)
 
final void cancelAuthorization (String service)
 
final void sendEvent (String service, String event)
 
final void logout (String service)
 

Detailed Description

Authorization should be extended to carry out the authorization's required for the Engine.

This is a single platform interface for any supported authorizations by the Engine. The authorization process shall be carried out by the individual providers, referred here as authorization service. The platform implementation is responsible to follow the protocol established by the authorization service. Please refer to the authorization service documentation for the protocol information.

Member Function Documentation

◆ eventReceived()

void com.amazon.aace.authorization.Authorization.eventReceived ( String  service,
String  event 
)

Notifies the platform implementation about the authorization event.

Parameters
serviceIndicates the authorization service.
eventJSON representation of the authorization event as defined by the authorization service.

◆ authorizationStateChanged()

void com.amazon.aace.authorization.Authorization.authorizationStateChanged ( String  service,
AuthorizationState  state 
)

Notifies the platform implementation about the authorization state change.

Parameters
serviceIndicates the authorization service.
stateThe authorization state represented using AuthorizationState

◆ authorizationError()

void com.amazon.aace.authorization.Authorization.authorizationError ( String  service,
String  error,
String  message 
)

Notifies the platform implementation about any error in the authorization process.

Parameters
serviceIndicates the authorization service.
errorIndicates the authorization error. The value is defined by the each authorization service.
messageError message for logging purpose.

◆ getAuthorizationData()

String com.amazon.aace.authorization.Authorization.getAuthorizationData ( String  service,
String  key 
)

Function to get the authorization data from the platform implementation.

Note
Call to this API need not necessarily require a call to the setAuthorizationData.
Parameters
serviceIndicates the authorization service.
keyThe key of the data requested.
Returns
Returns the value of the key if available otherwise returns an empty string.

◆ setAuthorizationData()

void com.amazon.aace.authorization.Authorization.setAuthorizationData ( String  service,
String  key,
String  data 
)

Function to set the authorization data in platform implementation. The platform implementation are expected to store these values securely.

Parameters
serviceIndicates the authorization service.
keyRepresents the key of the data
dataThe data to be set.

◆ startAuthorization()

final void com.amazon.aace.authorization.Authorization.startAuthorization ( String  service,
String  data 
)
protected

Notifies the Engine to start the authorization process. Engine to call authStateChanged with AUTHORIZING on the start of authorization process. Engine to call authStateChanged with AUTHORIZED on the successful authorization.

Parameters
serviceIndicates the authorization service.
dataRepresents the data in json format. The value of this is defined by each authorization service.

◆ cancelAuthorization()

final void com.amazon.aace.authorization.Authorization.cancelAuthorization ( String  service)
protected

Notifies the Engine to cancel the authorization.

Note
This does not logout the active authorization.
Parameters
serviceIndicates the authorization service.

◆ sendEvent()

final void com.amazon.aace.authorization.Authorization.sendEvent ( String  service,
String  event 
)
protected

The authorization event from platform implementation.

Parameters
serviceIndicates the authorization service.
eventRepresents the event in json format. The value of this is defined by each authorization service.

◆ logout()

final void com.amazon.aace.authorization.Authorization.logout ( String  service)
protected

Notifies the Engine to logout. Engine would call authStateChanged with UNAUTHORIZED on the successful logout.

Parameters
serviceIndicates the authorization service that needs to be logged out.

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