Search in sources :

Example 1 with ForgotPasswordRequest

use of com.amazonaws.services.cognitoidentityprovider.model.ForgotPasswordRequest in project aws-sdk-android by aws-amplify.

the class CognitoUser method forgotPasswordInternal.

/**
 * Internal method to start forgot password process.
 */
private ForgotPasswordResult forgotPasswordInternal(final Map<String, String> clientMetadata) {
    final ForgotPasswordRequest resetPasswordRequest = new ForgotPasswordRequest();
    resetPasswordRequest.setClientId(clientId);
    resetPasswordRequest.setSecretHash(secretHash);
    resetPasswordRequest.setUsername(userId);
    resetPasswordRequest.setUserContextData(getUserContextData());
    resetPasswordRequest.setClientMetadata(clientMetadata);
    final String pinpointEndpointId = pool.getPinpointEndpointId();
    if (pinpointEndpointId != null) {
        AnalyticsMetadataType amd = new AnalyticsMetadataType();
        amd.setAnalyticsEndpointId(pinpointEndpointId);
        resetPasswordRequest.setAnalyticsMetadata(amd);
    }
    return cognitoIdentityProviderClient.forgotPassword(resetPasswordRequest);
}
Also used : ConfirmForgotPasswordRequest(com.amazonaws.services.cognitoidentityprovider.model.ConfirmForgotPasswordRequest) ForgotPasswordRequest(com.amazonaws.services.cognitoidentityprovider.model.ForgotPasswordRequest) AnalyticsMetadataType(com.amazonaws.services.cognitoidentityprovider.model.AnalyticsMetadataType)

Aggregations

AnalyticsMetadataType (com.amazonaws.services.cognitoidentityprovider.model.AnalyticsMetadataType)1 ConfirmForgotPasswordRequest (com.amazonaws.services.cognitoidentityprovider.model.ConfirmForgotPasswordRequest)1 ForgotPasswordRequest (com.amazonaws.services.cognitoidentityprovider.model.ForgotPasswordRequest)1