public final class AWSMobileClient
extends java.lang.Object
implements com.amazonaws.auth.AWSCredentialsProvider
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
public void onResult(UserStateDetails userStateDetails) {
switch (userStateDetails.getUserState()) {
case SIGNED_IN:
break;
case SIGNED_OUT:
try {
AWSMobileClient.getInstance().showSignIn(MainActivity.this);
} catch (Exception e) {
Log.e("TAG", "", e);
}
break;
default:
Log.w("Unhandled state see UserState for a list of states");
break;
}
}
})
}
| Modifier and Type | Class and Description |
|---|---|
class |
AWSMobileClient.InitializeBuilder
Deprecated.
Since 2.8.0 This method will be removed in the next minor version.
Please update to use AWSMobileClient using `initialize`.
Please visit https://aws-amplify.github.io for the latest Android documentation.
|
class |
AWSMobileClient.SignInProviderConfig
Deprecated.
Since 2.8.0 This method will be removed in the next minor version.
Please update to use AWSMobileClient using `initialize`.
Please visit https://aws-amplify.github.io for the latest Android documentation.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHALLENGE_RESPONSE_NEW_PASSWORD_KEY |
static java.lang.String |
CHALLENGE_RESPONSE_USER_ATTRIBUTES_PREFIX_KEY |
static java.lang.String |
DEFAULT_USER_AGENT |
static java.lang.String |
HOSTED_UI_KEY |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Runnable |
_initialize(android.content.Context context,
com.amazonaws.mobile.config.AWSConfiguration awsConfiguration,
Callback<UserStateDetails> callback) |
void |
addUserStateListener(UserStateListener listener)
Adds a listener to be notified of state changes.
|
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword) |
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword,
Callback<java.lang.Void> callback) |
ForgotPasswordResult |
confirmForgotPassword(java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
java.lang.String forgotPasswordChallengeResponse)
Second method to call after
forgotPassword(String) to respond to any challenges
that the service may request. |
ForgotPasswordResult |
confirmForgotPassword(java.lang.String password,
java.lang.String forgotPasswordChallengeResponse)
Second method to call after
forgotPassword(String) to respond to any challenges
that the service may request. |
void |
confirmForgotPassword(java.lang.String password,
java.lang.String forgotPasswordChallengeResponse,
Callback<ForgotPasswordResult> callback)
Deprecated.
|
void |
confirmForgotPassword(java.lang.String password,
java.lang.String forgotPasswordChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<ForgotPasswordResult> callback)
Second method to call after
forgotPassword(String) to respond to any challenges
that the service may request. |
void |
confirmForgotPassword(java.lang.String username,
java.lang.String password,
java.lang.String forgotPasswordChallengeResponse,
Callback<ForgotPasswordResult> callback)
Second method to call after
forgotPassword(String) to respond to any challenges
that the service may request. |
SignInResult |
confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse)
|
void |
confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse,
Callback<SignInResult> callback)
|
SignInResult |
confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetaData)
|
void |
confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetaData,
Callback<SignInResult> callback)
|
SignInResult |
confirmSignIn(java.lang.String signInChallengeResponse) |
void |
confirmSignIn(java.lang.String signInChallengeResponse,
Callback<SignInResult> callback) |
SignInResult |
confirmSignIn(java.lang.String signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata) |
void |
confirmSignIn(java.lang.String signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignInResult> callback) |
SignInResult |
confirmSignIn(java.lang.String signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
java.util.Map<java.lang.String,java.lang.String> userAttributes) |
void |
confirmSignIn(java.lang.String signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
Callback<SignInResult> callback) |
SignUpResult |
confirmSignUp(java.lang.String username,
java.lang.String signUpChallengeResponse)
Confirm the sign-up request with follow-up information
|
void |
confirmSignUp(java.lang.String username,
java.lang.String signUpChallengeResponse,
Callback<SignUpResult> callback)
Confirm the sign-up request with follow-up information
|
SignUpResult |
confirmSignUp(java.lang.String username,
java.lang.String signUpChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata)
Confirm the sign-up request with follow-up information
|
void |
confirmSignUp(java.lang.String username,
java.lang.String signUpChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignUpResult> callback)
Confirm the sign-up request with follow-up information
|
void |
confirmUpdateUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse)
Confirm the attribute with the code provided by user.
|
void |
confirmUpdateUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse,
Callback<java.lang.Void> callback)
Confirm the attribute with the code provided by user.
|
void |
confirmVerifyUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse)
Confirm the attribute with the code provided by user.
|
void |
confirmVerifyUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse,
Callback<java.lang.Void> callback)
Confirm the attribute with the code provided by user.
|
UserStateDetails |
currentUserState()
Performs a check on the current UserState.
|
void |
currentUserState(Callback<UserStateDetails> callback)
Performs a check on the current UserState.
|
void |
deleteUser()
Delete the account of the currently logged-in user.
|
void |
deleteUser(Callback<java.lang.Void> callback)
Delete the account of the currently logged-in user.
|
UserStateDetails |
federatedSignIn(java.lang.String providerKey,
java.lang.String token)
Federate tokens from custom identity providers into Cognito Identity Pool by providing the
logins key and token
|
void |
federatedSignIn(java.lang.String providerKey,
java.lang.String token,
Callback<UserStateDetails> callback)
Federate tokens from custom identity providers into Cognito Identity Pool by providing the
logins key and token
|
UserStateDetails |
federatedSignIn(java.lang.String providerKey,
java.lang.String token,
FederatedSignInOptions options)
Federate tokens from custom identity providers by providing the
logins key and token
|
void |
federatedSignIn(java.lang.String providerKey,
java.lang.String token,
FederatedSignInOptions options,
Callback<UserStateDetails> callback)
Federate tokens from custom identity providers by providing the
logins key and token
|
protected void |
federatedSignInWithoutAssigningState(java.lang.String providerKey,
java.lang.String token) |
protected void |
federatedSignInWithoutAssigningState(java.lang.String providerKey,
java.lang.String token,
Callback<UserStateDetails> callback) |
protected void |
federateWithCognitoIdentity(java.lang.String providerKey,
java.lang.String token) |
ForgotPasswordResult |
forgotPassword(java.lang.String username)
Used to reset password if user forgot the old password.
|
void |
forgotPassword(java.lang.String username,
Callback<ForgotPasswordResult> callback)
Used to reset password if user forgot the old password.
|
ForgotPasswordResult |
forgotPassword(java.lang.String username,
java.util.Map<java.lang.String,java.lang.String> clientMetadata)
Used to reset password if user forgot the old password.
|
void |
forgotPassword(java.lang.String username,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<ForgotPasswordResult> callback)
Used to reset password if user forgot the old password.
|
com.amazonaws.auth.AWSCredentials |
getAWSCredentials()
Returns AWSCredentials obtained from Cognito Identity
|
void |
getAWSCredentials(Callback<com.amazonaws.auth.AWSCredentials> callback) |
com.amazonaws.mobile.config.AWSConfigurable |
getClient(android.content.Context context,
java.lang.Class<? extends com.amazonaws.mobile.config.AWSConfigurable> clientClass)
Get the AWSConfigurable client if exists, else create one and
add it to the clientMap and return.
|
com.amazonaws.mobile.config.AWSConfiguration |
getConfiguration()
Retrieve the AWSConfiguration object that represents
the awsconfiguration.json file.
|
com.amazonaws.auth.AWSCredentials |
getCredentials() |
DeviceOperations |
getDeviceOperations()
Retrieve a handle to perform device related operations.
|
java.lang.String |
getIdentityId() |
static AWSMobileClient |
getInstance()
Gets the singleton instance of this class.
|
Tokens |
getTokens()
Returns the tokens obtained from Cognito Userpools sign-in.
|
protected Tokens |
getTokens(boolean waitForSignIn) |
void |
getTokens(Callback<Tokens> callback)
Returns the tokens obtained from Cognito Userpools sign-in.
|
java.util.Map<java.lang.String,java.lang.String> |
getUserAttributes() |
void |
getUserAttributes(Callback<java.util.Map<java.lang.String,java.lang.String>> callback) |
java.lang.String |
getUsername()
Returns the username attribute of the current access token.
|
protected UserStateDetails |
getUserStateDetails(boolean offlineCheck)
Has side-effect of attempting to alert developer to try and sign-in user
when required to be signed-in and will mutate the user's state.
|
java.lang.String |
getUserSub()
Returns the Cognito User Sub attribute of the current access token.
|
boolean |
handleAuthResponse(android.content.Intent intent)
Pass in the Intent from the OAuth 2.0 exchange from
showSignIn(Activity) |
void |
initialize(android.content.Context context,
com.amazonaws.mobile.config.AWSConfiguration awsConfig,
Callback<UserStateDetails> callback) |
void |
initialize(android.content.Context context,
Callback<UserStateDetails> callback) |
protected boolean |
isNetworkAvailable(android.content.Context context)
Uses Android system commands to determine if the device is online.
|
boolean |
isSignedIn()
A variant of
currentUserState() that simplifies the output to a boolean. |
void |
refresh() |
void |
releaseSignInWait()
Release the wait for tokens to be refreshed
Doing this fails all pending operations that were
waiting for sign-in.
|
boolean |
removeUserStateListener(UserStateListener listener)
Removes a listener.
|
SignUpResult |
resendSignUp(java.lang.String username)
Used when a user has attempted sign-up previously and wants to continue the process.
|
void |
resendSignUp(java.lang.String username,
Callback<SignUpResult> callback)
Used when a user has attempted sign-up previously and wants to continue the process.
|
SignUpResult |
resendSignUp(java.lang.String username,
java.util.Map<java.lang.String,java.lang.String> clientMetadata)
Used when a user has attempted sign-up previously and wants to continue the process.
|
void |
resendSignUp(java.lang.String username,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignUpResult> callback)
Used when a user has attempted sign-up previously and wants to continue the process.
|
protected void |
setUserState(UserStateDetails details) |
UserStateDetails |
showSignIn(android.app.Activity callingActivity)
Shows a sign-in UI for user's to sign-in, sign-up, forgot password, create account
|
void |
showSignIn(android.app.Activity callingActivity,
Callback<UserStateDetails> callback)
Shows a sign-in UI for user's to sign-in, sign-up, forgot password, create account
|
UserStateDetails |
showSignIn(android.app.Activity callingActivity,
SignInUIOptions signInUIOptions)
Shows a sign-in UI for user's to sign-in, sign-up, forgot password, create account
|
void |
showSignIn(android.app.Activity callingActivity,
SignInUIOptions signInUIOptions,
Callback<UserStateDetails> callback)
Shows a sign-in UI for user's to sign-in, sign-up, forgot password, create account
|
SignInResult |
signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData) |
void |
signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
Callback<SignInResult> callback) |
SignInResult |
signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata) |
SignInResult |
signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
com.amazonaws.services.cognitoidentityprovider.model.AuthFlowType authFlowType) |
void |
signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
com.amazonaws.services.cognitoidentityprovider.model.AuthFlowType authFlowType,
Callback<SignInResult> callback) |
void |
signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignInResult> callback) |
void |
signOut()
Clears local tokens so that the client is in a signed-out state.
|
void |
signOut(SignOutOptions signOutOptions)
Sign-out the user with more options.
|
void |
signOut(SignOutOptions signOutOptions,
Callback<java.lang.Void> callback)
Sign-out the user with more options.
|
SignUpResult |
signUp(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> validationData)
Sign-up users.
|
void |
signUp(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> validationData,
Callback<SignUpResult> callback)
Sign-up users.
|
SignUpResult |
signUp(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
java.util.Map<java.lang.String,java.lang.String> validationData)
Sign-up users.
|
void |
signUp(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignUpResult> callback)
Sign-up users.
|
java.util.List<UserCodeDeliveryDetails> |
updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes)
Sends a map of user attributes to update.
|
void |
updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes,
Callback<java.util.List<UserCodeDeliveryDetails>> callback)
Sends a map of user attributes to update.
|
java.util.List<UserCodeDeliveryDetails> |
updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> clientMetadata)
Sends a map of user attributes to update.
|
void |
updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<java.util.List<UserCodeDeliveryDetails>> callback)
Sends a map of user attributes to update.
|
UserCodeDeliveryDetails |
verifyUserAttribute(java.lang.String attributeName)
Verify an attribute like email.
|
void |
verifyUserAttribute(java.lang.String attributeName,
Callback<UserCodeDeliveryDetails> callback)
Verify an attribute like email.
|
UserCodeDeliveryDetails |
verifyUserAttribute(java.lang.String attributeName,
java.util.Map<java.lang.String,java.lang.String> clientMetadata)
Verify an attribute like email.
|
void |
verifyUserAttribute(java.lang.String attributeName,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<UserCodeDeliveryDetails> callback)
Verify an attribute like email.
|
protected boolean |
waitForSignIn()
This method checks the current state of the user.
|
public static final java.lang.String DEFAULT_USER_AGENT
public static final java.lang.String HOSTED_UI_KEY
public static final java.lang.String CHALLENGE_RESPONSE_NEW_PASSWORD_KEY
public static final java.lang.String CHALLENGE_RESPONSE_USER_ATTRIBUTES_PREFIX_KEY
public static AWSMobileClient getInstance()
public com.amazonaws.mobile.config.AWSConfiguration getConfiguration()
public com.amazonaws.auth.AWSCredentials getCredentials()
getCredentials in interface com.amazonaws.auth.AWSCredentialsProviderpublic void refresh()
refresh in interface com.amazonaws.auth.AWSCredentialsProvider@WorkerThread
public com.amazonaws.auth.AWSCredentials getAWSCredentials()
throws java.lang.Exception
java.lang.Exception@AnyThread public void getAWSCredentials(Callback<com.amazonaws.auth.AWSCredentials> callback)
@AnyThread public java.lang.String getIdentityId()
@AnyThread
public void initialize(android.content.Context context,
Callback<UserStateDetails> callback)
@AnyThread
public void initialize(android.content.Context context,
com.amazonaws.mobile.config.AWSConfiguration awsConfig,
Callback<UserStateDetails> callback)
protected java.lang.Runnable _initialize(android.content.Context context,
com.amazonaws.mobile.config.AWSConfiguration awsConfiguration,
Callback<UserStateDetails> callback)
@AnyThread public DeviceOperations getDeviceOperations()
@AnyThread public void releaseSignInWait()
protected void setUserState(UserStateDetails details)
protected boolean isNetworkAvailable(android.content.Context context)
context - application context@AnyThread public java.lang.String getUsername()
@AnyThread public java.lang.String getUserSub()
@WorkerThread public UserStateDetails currentUserState()
@AnyThread public void currentUserState(Callback<UserStateDetails> callback)
@AnyThread public void addUserStateListener(UserStateListener listener)
releaseSignInWait() or any form of sign-in can be called
to prevent blocking getCredentials(), getTokens(), or other methods
requiring a sign-in.listener - @AnyThread public boolean removeUserStateListener(UserStateListener listener)
listener - @AnyThread public boolean isSignedIn()
currentUserState() that simplifies the output to a boolean.
True if SIGNED_IN, SIGNED_OUT_USER_POOLS_TOKENS_INVALID, SIGNED_OUT_FEDERATED_TOKENS_INVALID.
False if GUEST, SIGNED_OUT.protected boolean waitForSignIn()
UserStateListener will be
notified with @UserState.SIGNED_OUT_USER_POOLS_TOKENS_INVALID orprotected UserStateDetails getUserStateDetails(boolean offlineCheck)
offlineCheck - true, will determine if the tokens are expired or the credentials are expired and block for refresh@AnyThread
public void signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
Callback<SignInResult> callback)
@AnyThread
public void signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignInResult> callback)
@AnyThread
public void signIn(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
com.amazonaws.services.cognitoidentityprovider.model.AuthFlowType authFlowType,
Callback<SignInResult> callback)
@WorkerThread public SignInResult signIn(java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,java.lang.String> validationData) throws java.lang.Exception
java.lang.Exception@WorkerThread public SignInResult signIn(java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,java.lang.String> validationData, java.util.Map<java.lang.String,java.lang.String> clientMetadata) throws java.lang.Exception
java.lang.Exception@WorkerThread public SignInResult signIn(java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,java.lang.String> validationData, java.util.Map<java.lang.String,java.lang.String> clientMetadata, com.amazonaws.services.cognitoidentityprovider.model.AuthFlowType authFlowType) throws java.lang.Exception
java.lang.Exception@AnyThread
public void confirmSignIn(java.lang.String signInChallengeResponse,
Callback<SignInResult> callback)
@AnyThread
public void confirmSignIn(java.lang.String signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignInResult> callback)
@AnyThread
public void confirmSignIn(java.lang.String signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
Callback<SignInResult> callback)
@WorkerThread public SignInResult confirmSignIn(java.lang.String signInChallengeResponse) throws java.lang.Exception
java.lang.Exception@WorkerThread public SignInResult confirmSignIn(java.lang.String signInChallengeResponse, java.util.Map<java.lang.String,java.lang.String> clientMetadata) throws java.lang.Exception
java.lang.Exception@WorkerThread public SignInResult confirmSignIn(java.lang.String signInChallengeResponse, java.util.Map<java.lang.String,java.lang.String> clientMetadata, java.util.Map<java.lang.String,java.lang.String> userAttributes) throws java.lang.Exception
java.lang.Exception@AnyThread
public void confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetaData,
Callback<SignInResult> callback)
signIn(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>, com.amazonaws.mobile.client.Callback<com.amazonaws.mobile.client.results.SignInResult>).
Call with the user's response to the sign-in challenge.signInChallengeResponse - obtained from userclientMetaData - Meta data for lambda triggerscallback - callback@WorkerThread public SignInResult confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse, java.util.Map<java.lang.String,java.lang.String> clientMetaData) throws java.lang.Exception
signIn(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>, com.amazonaws.mobile.client.Callback<com.amazonaws.mobile.client.results.SignInResult>).
Call with the user's response to the sign-in challenge.signInChallengeResponse - obtained from userclientMetaData - Meta data for lambda triggersjava.lang.Exception@AnyThread
public void confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse,
Callback<SignInResult> callback)
signIn(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>, com.amazonaws.mobile.client.Callback<com.amazonaws.mobile.client.results.SignInResult>).
Call with the user's response to the sign-in challenge.signInChallengeResponse - obtained from usercallback - callback@WorkerThread public SignInResult confirmSignIn(java.util.Map<java.lang.String,java.lang.String> signInChallengeResponse) throws java.lang.Exception
signIn(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>, com.amazonaws.mobile.client.Callback<com.amazonaws.mobile.client.results.SignInResult>).
Call with the user's response to the sign-in challenge.signInChallengeResponse - obtained from userjava.lang.Exception@AnyThread public void signOut()
@WorkerThread public void signOut(SignOutOptions signOutOptions) throws java.lang.Exception
SignOutOptions.builder()
.signOutGlobally(true) // Sign-out user from all sessions across devices
.build();
signOutOptions - optionsjava.lang.Exception@AnyThread public void signOut(SignOutOptions signOutOptions, Callback<java.lang.Void> callback)
SignOutOptions.builder()
.signOutGlobally(true) // Sign-out user from all sessions across devices
.build();
signOutOptions - options@WorkerThread
public void deleteUser()
throws java.lang.Exception
java.lang.Exception - if the user cannot be deleted successfully@AnyThread public void deleteUser(Callback<java.lang.Void> callback)
callback - the callback will be invoked to notify the success or
failure of the deleteUser operation@AnyThread
public void federatedSignIn(java.lang.String providerKey,
java.lang.String token,
Callback<UserStateDetails> callback)
The logins key can be specified with IdentityProvider#AMAZON#toString()
providerKey - Custom provider key i.e. Google sign-in's key is accounts.google.comtoken - the JWT token vended by the third-party@WorkerThread public UserStateDetails federatedSignIn(java.lang.String providerKey, java.lang.String token) throws java.lang.Exception
The logins key can be specified with IdentityProvider.AMAZON
providerKey - Custom provider key i.e. Google sign-in's key is accounts.google.comtoken - the JWT token vended by the third-partyjava.lang.Exception@AnyThread
public void federatedSignIn(java.lang.String providerKey,
java.lang.String token,
FederatedSignInOptions options,
Callback<UserStateDetails> callback)
The logins key can be specified with IdentityProvider#AMAZON#toString()
providerKey - Custom provider key i.e. Google sign-in's key is accounts.google.comtoken - the JWT token vended by the third-party@WorkerThread public UserStateDetails federatedSignIn(java.lang.String providerKey, java.lang.String token, FederatedSignInOptions options) throws java.lang.Exception
The logins key can be specified with IdentityProvider.AMAZON
providerKey - Custom provider key i.e. Google sign-in's key is accounts.google.comtoken - the JWT token vended by the third-partyjava.lang.Exceptionprotected void federatedSignInWithoutAssigningState(java.lang.String providerKey,
java.lang.String token)
throws java.lang.Exception
java.lang.Exceptionprotected void federatedSignInWithoutAssigningState(java.lang.String providerKey,
java.lang.String token,
Callback<UserStateDetails> callback)
protected void federateWithCognitoIdentity(java.lang.String providerKey,
java.lang.String token)
@WorkerThread public Tokens getTokens() throws java.lang.Exception
java.lang.Exception - when the tokens cannot be retrieved successfully.@AnyThread public void getTokens(Callback<Tokens> callback)
java.lang.Exception - when the tokens cannot be retrieved successfully.protected Tokens getTokens(boolean waitForSignIn) throws java.lang.Exception
java.lang.Exception@AnyThread
public void signUp(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> validationData,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignUpResult> callback)
SignUpResult will contain next steps if necessary.
Call confirmSignUp(String, String, Callback) with the necessary next
step code obtained from user.username - username/email address/handlepassword - user's passworduserAttributes - attributes associated with uservalidationData - optional, set of data to validate the sign-up requestclientMetadata - meta data to be passed to the lambdas invoked by sign up operation.callback - callback will be invoked to notify the success or failure of the
SignUp operation@WorkerThread public SignUpResult signUp(java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,java.lang.String> userAttributes, java.util.Map<java.lang.String,java.lang.String> clientMetadata, java.util.Map<java.lang.String,java.lang.String> validationData) throws java.lang.Exception
SignUpResult will contain next steps if necessary.
Call confirmSignUp(String, String) with the necessary next step code obtained from user.username - username/email address/handlepassword - user's passworduserAttributes - attributes associated with uservalidationData - optional, set of data to validate the sign-up requestclientMetadata - meta data to be passed to the lambdas invoked by sign up operation.java.lang.Exception - if there is any error generated by the client@AnyThread
public void signUp(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> validationData,
Callback<SignUpResult> callback)
SignUpResult will contain next steps if necessary.
Call confirmSignUp(String, String, Callback) with the necessary next
step code obtained from user.username - username/email address/handlepassword - user's passworduserAttributes - attributes associated with uservalidationData - optional, set of data to validate the sign-up requestcallback - callback will be invoked to notify the success or failure of the
SignUp operation@WorkerThread public SignUpResult signUp(java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,java.lang.String> userAttributes, java.util.Map<java.lang.String,java.lang.String> validationData) throws java.lang.Exception
SignUpResult will contain next steps if necessary.
Call confirmSignUp(String, String) with the necessary next step code obtained from user.username - username/email address/handlepassword - user's passworduserAttributes - attributes associated with uservalidationData - optional, set of data to validate the sign-up requestjava.lang.Exception - if there is any error generated by the client@AnyThread
public void confirmSignUp(java.lang.String username,
java.lang.String signUpChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignUpResult> callback)
username - username/email address/handle of the user who is signing upsignUpChallengeResponse - response to the signUp challenge postedclientMetadata - meta data to be passed to the lambdas invoked by confirm sign up operation.callback - the callback will be invoked to notify the success or
failure of the confirmSignUp operation@WorkerThread public SignUpResult confirmSignUp(java.lang.String username, java.lang.String signUpChallengeResponse, java.util.Map<java.lang.String,java.lang.String> clientMetadata) throws java.lang.Exception
username - username of the user who is signing upsignUpChallengeResponse - response to the signUp challenge postedclientMetadata - meta data to be passed to the lambdas invoked by confirm sign up operation.java.lang.Exception@AnyThread
public void confirmSignUp(java.lang.String username,
java.lang.String signUpChallengeResponse,
Callback<SignUpResult> callback)
username - username/email address/handle of the user who is signing upsignUpChallengeResponse - response to the signUp challenge postedcallback - the callback will be invoked to notify the success or
failure of the confirmSignUp operation@WorkerThread public SignUpResult confirmSignUp(java.lang.String username, java.lang.String signUpChallengeResponse) throws java.lang.Exception
username - username of the user who is signing upsignUpChallengeResponse - response to the signUp challenge postedjava.lang.Exception@AnyThread
public void resendSignUp(java.lang.String username,
Callback<SignUpResult> callback)
username - callback - @AnyThread
public void resendSignUp(java.lang.String username,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<SignUpResult> callback)
clientMetadata - A map of custom key-value pairs that is passed to the lambda function for
custom workflow.username - callback - @WorkerThread public SignUpResult resendSignUp(java.lang.String username) throws java.lang.Exception
username - java.lang.Exception@WorkerThread public SignUpResult resendSignUp(java.lang.String username, java.util.Map<java.lang.String,java.lang.String> clientMetadata) throws java.lang.Exception
clientMetadata - A map of custom key-value pairs that is passed to the lambda function for
custom workflow.username - java.lang.Exception@AnyThread
public void forgotPassword(java.lang.String username,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<ForgotPasswordResult> callback)
username - username of the user trying to reset password.clientMetadata - meta data to be passed to the lambdas invoked by confirm sign up operation.callback - callback will be invoked to notify the success or failure of the
forgot password operation@WorkerThread public ForgotPasswordResult forgotPassword(java.lang.String username, java.util.Map<java.lang.String,java.lang.String> clientMetadata) throws java.lang.Exception
username - username of the user trying to reset password.java.lang.Exception@AnyThread
public void forgotPassword(java.lang.String username,
Callback<ForgotPasswordResult> callback)
username - username of the user trying to reset password.callback - callback will be invoked to notify the success or failure of the
forgot password operation@WorkerThread public ForgotPasswordResult forgotPassword(java.lang.String username) throws java.lang.Exception
username - username of the user trying to reset password.java.lang.Exception@AnyThread
public void confirmForgotPassword(java.lang.String password,
java.lang.String forgotPasswordChallengeResponse,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<ForgotPasswordResult> callback)
forgotPassword(String) to respond to any challenges
that the service may request.password - new passwordforgotPasswordChallengeResponse - response to the forgot password challenge postedclientMetadata - metadata to be passed to the lambda invoked by this operation.callback - callback will be invoked to notify the success or failure of the
confirm forgot password operation@WorkerThread public ForgotPasswordResult confirmForgotPassword(java.lang.String password, java.util.Map<java.lang.String,java.lang.String> clientMetadata, java.lang.String forgotPasswordChallengeResponse) throws java.lang.Exception
forgotPassword(String) to respond to any challenges
that the service may request.password - new password.clientMetadata - metadata to be passed to the lambda invoked by this operation.forgotPasswordChallengeResponse - response to the forgot password challenge posted.java.lang.Exception@AnyThread
@Deprecated
public void confirmForgotPassword(java.lang.String password,
java.lang.String forgotPasswordChallengeResponse,
Callback<ForgotPasswordResult> callback)
forgotPassword(String) to respond to any challenges
that the service may request.password - new password.forgotPasswordChallengeResponse - response to the forgot password challenge posted.callback - callback will be invoked to notify the success or failure of the
confirm forgot password operation@AnyThread
public void confirmForgotPassword(java.lang.String username,
java.lang.String password,
java.lang.String forgotPasswordChallengeResponse,
Callback<ForgotPasswordResult> callback)
forgotPassword(String) to respond to any challenges
that the service may request.password - new password.forgotPasswordChallengeResponse - response to the forgot password challenge posted.callback - callback will be invoked to notify the success or failure of the
confirm forgot password operation@WorkerThread public ForgotPasswordResult confirmForgotPassword(java.lang.String password, java.lang.String forgotPasswordChallengeResponse) throws java.lang.Exception
forgotPassword(String) to respond to any challenges
that the service may request.password - new password.forgotPasswordChallengeResponse - response to the forgot password challenge posted.java.lang.Exception@AnyThread
public void changePassword(java.lang.String oldPassword,
java.lang.String newPassword,
Callback<java.lang.Void> callback)
@WorkerThread
public void changePassword(java.lang.String oldPassword,
java.lang.String newPassword)
throws java.lang.Exception
java.lang.Exception@AnyThread public void getUserAttributes(Callback<java.util.Map<java.lang.String,java.lang.String>> callback)
@WorkerThread
public java.util.Map<java.lang.String,java.lang.String> getUserAttributes()
throws java.lang.Exception
java.lang.Exception@AnyThread
public void updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes,
Callback<java.util.List<UserCodeDeliveryDetails>> callback)
userAttributes - the attributes i.e. emailcallback - verification delivery information@AnyThread
public void updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<java.util.List<UserCodeDeliveryDetails>> callback)
userAttributes - the attributes i.e. emailclientMetadata - A map of custom key-value pairs that is passed to the lambda function for
custom workflow.callback - verification delivery information@WorkerThread public java.util.List<UserCodeDeliveryDetails> updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes) throws java.lang.Exception
userAttributes - the attributes i.e. emailjava.lang.Exception@WorkerThread public java.util.List<UserCodeDeliveryDetails> updateUserAttributes(java.util.Map<java.lang.String,java.lang.String> userAttributes, java.util.Map<java.lang.String,java.lang.String> clientMetadata) throws java.lang.Exception
userAttributes - the attributes i.e. emailclientMetadata - A map of custom key-value pairs that is passed to the lambda function for
custom workflow.java.lang.Exception@AnyThread
public void verifyUserAttribute(java.lang.String attributeName,
Callback<UserCodeDeliveryDetails> callback)
attributeName - i.e. emailcallback - verification delivery information@AnyThread
public void verifyUserAttribute(java.lang.String attributeName,
java.util.Map<java.lang.String,java.lang.String> clientMetadata,
Callback<UserCodeDeliveryDetails> callback)
attributeName - i.e. emailclientMetadata - A map of custom key-value pairs that is passed to the lambda function for
lambda functions triggered by forgot password.callback - verification delivery information@WorkerThread public UserCodeDeliveryDetails verifyUserAttribute(java.lang.String attributeName) throws java.lang.Exception
attributeName - i.e. emailjava.lang.Exception@WorkerThread public UserCodeDeliveryDetails verifyUserAttribute(java.lang.String attributeName, java.util.Map<java.lang.String,java.lang.String> clientMetadata) throws java.lang.Exception
attributeName - i.e. emailclientMetadata - A map of custom key-value pairs that is passed to the lambda function for
lambda functions triggered by forgot password.java.lang.Exception@AnyThread
public void confirmUpdateUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse,
Callback<java.lang.Void> callback)
attributeName - i.e. emailupdateUserAttributeChallengeResponse - i.e. 123456callback - callback@WorkerThread
public void confirmUpdateUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse)
throws java.lang.Exception
attributeName - i.e. emailupdateUserAttributeChallengeResponse - i.e. 123456java.lang.Exception@AnyThread
public void confirmVerifyUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse,
Callback<java.lang.Void> callback)
attributeName - i.e. emailupdateUserAttributeChallengeResponse - i.e. 123456callback - callback@WorkerThread
public void confirmVerifyUserAttribute(java.lang.String attributeName,
java.lang.String updateUserAttributeChallengeResponse)
throws java.lang.Exception
attributeName - i.e. emailupdateUserAttributeChallengeResponse - i.e. 123456java.lang.Exception@AnyThread public boolean handleAuthResponse(android.content.Intent intent)
showSignIn(Activity)intent - @AnyThread
public void showSignIn(android.app.Activity callingActivity,
Callback<UserStateDetails> callback)
callingActivity - The activity that the sign-in screen will be shown on top of.callback - callback with UserStateDetails at end of operation@WorkerThread public UserStateDetails showSignIn(android.app.Activity callingActivity) throws java.lang.Exception
callingActivity - The activity that the sign-in screen will be shown on top of.java.lang.Exception@AnyThread
public void showSignIn(android.app.Activity callingActivity,
SignInUIOptions signInUIOptions,
Callback<UserStateDetails> callback)
callingActivity - The activity that the sign-in screen will be shown on top of.signInUIOptions - Override any default configuration with your preferences.callback - callback with UserStateDetails at end of operation@WorkerThread public UserStateDetails showSignIn(android.app.Activity callingActivity, SignInUIOptions signInUIOptions) throws java.lang.Exception
callingActivity - The activity that the sign-in screen will be shown on top of.signInUIOptions - Override any default configuration with your preferences.java.lang.Exceptionpublic com.amazonaws.mobile.config.AWSConfigurable getClient(android.content.Context context,
java.lang.Class<? extends com.amazonaws.mobile.config.AWSConfigurable> clientClass)
context - The activity contextclientClass - SDK Client Class that confirms to the AWSConfigurable interface.