public final class CognitoDeviceHelper extends 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(String username,
String userPoolId,
String deviceGroupKey,
android.content.Context context)
This method caches the device group key.
|
static void |
cacheDeviceKey(String username,
String userPoolId,
String deviceKey,
android.content.Context context)
This method caches the device key.
|
static void |
cacheDeviceVerifier(String username,
String userPoolId,
String deviceSecret,
android.content.Context context)
This method caches the device verifier.
|
static void |
clearCachedDevice(String username,
String userPoolId,
android.content.Context context)
Clears cached device details for this user.
|
static String |
generateRandomString()
Returns a string with random characters.
|
static Map<String,String> |
generateVerificationParameters(String deviceKey,
String deviceGroup)
Generates SRP verification parameters for device verification.
|
static String |
getDeviceGroupKey(String username,
String userPoolId,
android.content.Context context)
Returns the cached device group key for this device.
|
static String |
getDeviceKey(String username,
String userPoolId,
android.content.Context context)
Returns the cached key for this device.
|
static String |
getDeviceName()
Uses the Android class
android.os.build to return the model of
the android device. |
static String |
getDeviceSecret(String username,
String userPoolId,
android.content.Context context)
Returns the cached device secret for this device.
|
public static final int DEFAULT_DEVICE_PAGINATION_LIMIT
public static String getDeviceName()
android.os.build to return the model of
the android device.public static String getDeviceKey(String username, String userPoolId, android.content.Context context)
username - REQUIRED: The current user.userPoolId - REQUIRED: Client ID of the application.context - REQUIRED: Application context.public static String getDeviceSecret(String username, String userPoolId, android.content.Context context)
username - REQUIRED: The current user.userPoolId - REQUIRED: Client ID of the application.context - REQUIRED: Application context.public static String getDeviceGroupKey(String username, 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(String username, String userPoolId, 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(String username, String userPoolId, 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(String username, String userPoolId, 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(String username, 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 Map<String,String> generateVerificationParameters(String deviceKey, String deviceGroup)
deviceKey - REQUIRED: Username this device belongs to.deviceGroup - REQUIRED: This is the device group id returned by the service.Map.public static String generateRandomString()
Copyright © 2018. All rights reserved.