public final class CognitoDeviceHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CognitoDeviceHelper.deviceSRP
Static class for SRP related calculations for devices.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DEVICE_PAGINATION_LIMIT
Default pagination limit.
|
Constructor and Description |
---|
CognitoDeviceHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheDeviceGroupKey(java.lang.String username,
java.lang.String userPoolId,
java.lang.String deviceGroupKey,
android.content.Context context)
This method caches the device group key.
|
static void |
cacheDeviceKey(java.lang.String username,
java.lang.String userPoolId,
java.lang.String deviceKey,
android.content.Context context)
This method caches the device key.
|
static void |
cacheDeviceVerifier(java.lang.String username,
java.lang.String userPoolId,
java.lang.String deviceSecret,
android.content.Context context)
This method caches the device verifier.
|
static void |
clearCachedDevice(java.lang.String username,
java.lang.String userPoolId,
android.content.Context context)
Clears cached device details for this user.
|
static java.lang.String |
generateRandomString()
Returns a string with random characters.
|
static java.util.Map<java.lang.String,java.lang.String> |
generateVerificationParameters(java.lang.String deviceKey,
java.lang.String deviceGroup)
Generates SRP verification parameters for device verification.
|
static java.lang.String |
getDeviceGroupKey(java.lang.String username,
java.lang.String userPoolId,
android.content.Context context)
Returns the cached device group key for this device.
|
static java.lang.String |
getDeviceKey(java.lang.String username,
java.lang.String userPoolId,
android.content.Context context)
Returns the cached key for this device.
|
static java.lang.String |
getDeviceName()
Uses the Android class
Build to return the model of
the android device. |
static java.lang.String |
getDeviceSecret(java.lang.String username,
java.lang.String userPoolId,
android.content.Context context)
Returns the cached device secret for this device.
|
static void |
setPersistenceEnabled(boolean isPersistenceEnabled)
Set the flag that indicates if the persistence is enabled or not.
|
public static final int DEFAULT_DEVICE_PAGINATION_LIMIT
public static void setPersistenceEnabled(boolean isPersistenceEnabled)
isPersistenceEnabled
- flag that indicates if the persistence is enabled or not.public static java.lang.String getDeviceName()
Build
to return the model of
the android device.public static java.lang.String getDeviceKey(java.lang.String username, java.lang.String userPoolId, android.content.Context context)
username
- REQUIRED: The current user.userPoolId
- REQUIRED: Client ID of the application.context
- REQUIRED: Application context.public static java.lang.String getDeviceSecret(java.lang.String username, java.lang.String userPoolId, android.content.Context context)
username
- REQUIRED: The current user.userPoolId
- REQUIRED: Client ID of the application.context
- REQUIRED: Application context.public static java.lang.String getDeviceGroupKey(java.lang.String username, java.lang.String userPoolId, android.content.Context context)
username
- REQUIRED: The current user.userPoolId
- REQUIRED: Client ID of the application.context
- REQUIRED: Application context.public static void cacheDeviceKey(java.lang.String username, java.lang.String userPoolId, java.lang.String deviceKey, android.content.Context context)
username
- REQUIRED: The current user.userPoolId
- REQUIRED: Client ID of the device.deviceKey
- REQUIRED: Cognito assigned device key.context
- REQUIRED: App context, needed to access device datastore.public static void cacheDeviceVerifier(java.lang.String username, java.lang.String userPoolId, java.lang.String deviceSecret, android.content.Context context)
username
- REQUIRED: The current user.userPoolId
- REQUIRED: Client ID of the device.deviceSecret
- REQUIRED: Cognito assigned device key.context
- REQUIRED: App context, needed to access device datastore.public static void cacheDeviceGroupKey(java.lang.String username, java.lang.String userPoolId, java.lang.String deviceGroupKey, android.content.Context context)
username
- REQUIRED: The current user.userPoolId
- REQUIRED: Client ID of the device.deviceGroupKey
- REQUIRED: Cognito assigned device group key.context
- REQUIRED: App context, needed to access device datastore.public static void clearCachedDevice(java.lang.String username, java.lang.String userPoolId, android.content.Context context)
username
- REQUIRED: The current user.userPoolId
- REQUIRED: Client ID of the device.context
- REQUIRED: App context, needed to access device datastore.public static java.util.Map<java.lang.String,java.lang.String> generateVerificationParameters(java.lang.String deviceKey, java.lang.String deviceGroup)
deviceKey
- REQUIRED: Username this device belongs to.deviceGroup
- REQUIRED: This is the device group id returned by the service.Map
.public static java.lang.String generateRandomString()
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.