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);
}
Aggregations