title: AWS Cognito login using preferred_username
body: <p>I have created a user pool with username and email as signing options. I want to sign using email instead of username. If I login using email need to pass username also. please find below code for sign-in.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>var authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({
          Username : 'user@email.coma',
          Password : '4E4RLkjh6@3ko',
      });
  
      var userData = {
          Username : 'hd8234fws32-43saaa',
          Pool : userPool
      };
      var cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData);
      cognitoUser.authenticateUser(authenticationDetails....</code></pre>
  </div>
  </div>
  </p>
  <p>Is there any way to sign in using email without username.</p>
  <p><strong>basic requirement is using cognito pool to manage users and user can change their email address any time.</strong></p>