public class TokenManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
TokenManager.TokenCallback |
static class |
TokenManager.TokenResponse |
static interface |
TokenManager.TokenResponseCallback |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PREF_ACCESS_TOKEN |
static java.lang.String |
PREF_REFRESH_TOKEN |
static java.lang.String |
PREF_TOKEN_EXPIRES |
Constructor and Description |
---|
TokenManager() |
Modifier and Type | Method and Description |
---|---|
static void |
getAccessToken(com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager authorizationManager,
Context context,
TokenManager.TokenCallback callback)
Check if we have a pre-existing access token, and whether that token is expired.
|
static void |
getAccessToken(Context context,
java.lang.String authCode,
java.lang.String codeVerifier,
com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager authorizationManager,
TokenManager.TokenResponseCallback callback)
Get an access token from the Amazon servers for the current user
|
public static final java.lang.String PREF_ACCESS_TOKEN
public static final java.lang.String PREF_REFRESH_TOKEN
public static final java.lang.String PREF_TOKEN_EXPIRES
public static void getAccessToken(Context context, @NotNull java.lang.String authCode, @NotNull java.lang.String codeVerifier, com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager authorizationManager, @Nullable TokenManager.TokenResponseCallback callback)
context
- local/application level contextauthCode
- the authorization code supplied by the Authorization ManagercodeVerifier
- a randomly generated verifier, must be the same every timeauthorizationManager
- the AuthorizationManager class calling this functioncallback
- the callback for state changespublic static void getAccessToken(@NotNull com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager authorizationManager, @NotNull Context context, @NotNull TokenManager.TokenCallback callback)
authorizationManager
- our AuthManagercontext
- local/application contextcallback
- the TokenCallback where we return our tokens when successful