title: AWS Cognito user pools
body: <p>I am using AWS Amplify for Flutter plugin to use Cognito for User authentication. When I executed <code>amplify add auth</code> followed by <code>amplify push</code>, a CloudFormation stack is created with several resources -including a User Pool and Identity pool.Two app clients are also created. One of them is being referred in the <code>lib/amplifyconfiguration.dart</code> in my Flutter App.</p>
  <p>Using the Cognito API, I able to sign up new users to the User pool. I am able fetch Secret Keys, ID token using the following code.</p>
  <pre><code>CognitoAuthSession session = await Amplify.Auth.fetchAuthSession(options: CognitoSessionOptions(getAWSCredentials: true));
  
  print('Access key: ${session.credentials.awsAccessKey}');
  print('Secret Key: ${session.credentials.awsSecretKey}');
  print('Identity ID:  ${session.identityId}');
  print('User Pool tokens: ${session.userPoolTokens.accessToken}');
  print('User Pool tokens: ${session.userPoolTokens.idToken}');
  </code></pre>
  <p><a href="https://i.stack.imgur.com/4Z9fP.png" rel="nofollow noreferrer">Userpool</a></p>
  <p>What I don't understand is the app client that is referenced in the app did not enable the User pool  as identity provider (See the picture). Also no OAuth Flow is selected.</p>
  <ol>
  <li>My assumption is that since the <code>Cognito User Pool</code> is not enabled for the app client, when I tried to add a new user, the could should fail. But, it did not.</li>
  <li>As no OAuth flow selected, no ID Token should be returned. But I could fetch ID Token, access token.</li>
  </ol>
  <p>The Amplify cli also created an Identity pool, a couple of roles (for Unauthenticated, and authentcated users). It is referencing the User pool.</p>
  <p>What am I missing here ? Even though the User pool is not enabled, how it is able to store users ?</p>
  <p>Thank you for your time.</p>