title: AWS getting all Users from aws cognitio with JS
body: <p>how can I get all Users from aws cognito?</p>
  
  <p>I found this: list Users
  <a href="http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#listUsers-property" rel="nofollow noreferrer">http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#listUsers-property</a></p>
  
  <pre><code>    var cognito = new AWSCognito.CognitoIdentityServiceProvider;
  
      cognito.listUsers(params, function(err, data) {
          if (err) console.log(err, err.stack); // an error occurred
          else     console.log(data);           // successful response
      });
  </code></pre>
  
  <p>But when I do this I got this error:</p>
  
  <p>No reagon defined ... </p>
  
  <p>also tried this:</p>
  
  <pre><code>  AWS.config.region = 'eu-central-1'; // Region
      AWS.config.credentials = new AWS.CognitoIdentityCredentials({
          IdentityPoolId: 'eu-central-1:',
          Logins: {
              'cognito-idp.eu-central-1.amazonaws.com/eu-central-1_': result.getIdToken().getJwtToken()
          }
      });
  </code></pre>
  
  <p>here I got result is not defined ... </p>
  
  <p>how can I fetch all Users?</p>