title: Cannot sign out the user from AWS Cognito
body: <p>I have set up an API Gateway authenticated using AWS Cognito. Once the user signs in, I use the following script to verify their credentials:</p>
  
  <pre><code>const cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
  const params = {
      AuthFlow: 'ADMIN_NO_SRP_AUTH',
      ClientId: APP_CLIENT_ID,
      UserPoolId: USER_POOL_ID,
      AuthParameters: {
          'USERNAME': username,
          'PASSWORD': password,
      },
  };
  return cognitoidentityserviceprovider.adminInitiateAuth(params)
      .promise();
  </code></pre>
  
  <p>And this will return a JSON like so:</p>
  
  <pre><code>{
      "ChallengeParameters": {},
      "AuthenticationResult": {
          "AccessToken": "....",
          "ExpiresIn": 3600,
          "TokenType": "Bearer",
          "RefreshToken": "....",
          "IdToken": "...."
      }
  }
  </code></pre>
  
  <p>On the client side, I will take note of the <code>IdToken</code> and include it as a header with a name mentioned in the API Gateway's Authorizer.</p>
  
  <p>Now, I'm trying to create a lambda function to sign the user out. So far, I've got this:</p>
  
  <pre><code>const cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
  
  const params = {
      UserPoolId: USER_POOL_ID,
      Username: username,
  };
  return cognitoidentityserviceprovider.adminUserGlobalSignOut(params)
      .promise();
  </code></pre>
  
  <p>When I send a request to call this code, even though everything works just fine (no error is thrown), but the <code>IdToken</code> is still valid and I can still call authenticated requests with it. My question is, what is the proper way of signing out a user and why this is not working?</p>