title: AWS Cognito Email Verification
body: <p>I am trying to utilize AWS Cognito User Pools in my cross platform Xamarin app. I correctly begin registration for the user in the user pool (The user shows up in the user pool and the email with the verification code is sent). I can't seem to figure out the correct way to verify the users email to confirm them in the user pool. I keep getting NotAuthorizedException.</p>
  
  <p><strong>--------EDIT: The code blocks below have been updated to my latest attempts--------</strong></p>
  
  <p>Code for registering user:</p>
  
  <pre><code>public async Task&lt;Exception&gt; RegisterUserInUserPool(String sUsername, String sPassword, String sEmail)
      {
  
          AmazonCognitoIdentityProviderClient oClient = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), Amazon.RegionEndpoint.USEast2);
          CognitoUserPool oUserPool = new CognitoUserPool(sUserPoolID, sClientID, oClient);
  
          try
          {
              await oUserPool.SignUpAsync(sUsername, sPassword, new Dictionary&lt;string, string&gt; { { "email", sEmail } }, null);
              return null;
          }
          catch (Exception e)
          {
              return e;
          }
      }
  </code></pre>
  
  <p>My latest attempt at verifying the user:</p>
  
  <pre><code>public async Task&lt;Exception&gt; VerifyEmail(String sUsername, String sVerificationCode)
      {
  
          CognitoAWSCredentials oCreds = new CognitoAWSCredentials(sIdentityPoolID, Amazon.RegionEndpoint.USEast2);
          AmazonCognitoIdentityProviderClient oClient = new AmazonCognitoIdentityProviderClient(oCreds, Amazon.RegionEndpoint.USEast2);
          CognitoUserPool oUserPool = new CognitoUserPool(sUserPoolID, sClientID, oClient);
          CognitoUser oCognitoUser = new CognitoUser(sUsername, sClientID, oUserPool, oClient);
  
          try
          {
              await oCognitoUser.ConfirmSignUpAsync(sVerificationCode, false);
              return null;
          }
          catch (Exception e)
          {
              return e;
          }
      }
  </code></pre>
  
  <p><strong>EDIT: The updated code above for confirming user verification is returning a NotAuthorizedException exception that says "Unauthenticated access is not supported for this identity pool."<br>
  What are the correct settings for the user pool to allow this kind of confirmation? Is my code missing any steps?</strong></p>
  
  <p>Any help or clarification is appreciated!</p>