title: Giving user capability of resetting expired temporary password in cognito
body: <p>I know admin can reset user's temporary password from console using the following command </p>
  
  <pre><code>aws cognito-idp admin-create-user --region us-east-1 --user-pool-id us-east-1_youruserpoolid --username theusername --message-action RESEND
  </code></pre>
  
  <p>But here I need something where user have a trigger option, and after that trigger he should get new temp password to his email. It is something like self service option, where user don't have to call admin for resetting his temp password. </p>
  
  <p>I tried using <code>resendConfirmationCode</code> from </p>
  
  <pre><code>https://github.com/aws-amplify/amplify-js/blob/master/packages/amazon-cognito-identity-js/src/CognitoUser.js
  </code></pre>
  
  <p>with request :</p>
  
  <pre><code>{ClientId: "v3miuf2k********", Username: "suni*********"}
  </code></pre>
  
  <p>getting response as:</p>
  
  <pre><code>{code: "NotAuthorizedException", name: "NotAuthorizedException", message:  "Can't resend confirmation code for this user"}
  </code></pre>
  
  <blockquote>
    <p>code: "NotAuthorizedException"<br>
        message: "Can't resend confirmation code for this user"<br>
        name: "NotAuthorizedException"</p>
  </blockquote>