title: AWS Cognito / Getting user information from the sub
body: <p>I have a working iOS app using AWS Cognito AWSMobileClient where users can sign in and log in/out with AWSAuthUI.</p>
  
  <p>What I want to do next is: having a sub from another user (e.g. 7y873ff7-.....u9h4k) I would like to get the information from that other user.</p>
  
  <p>After searching the net it seems that I need to use something called ListUsers, but I am not 100% confident. Can anyone confirm this and give me some tip about how I need to go to get done what I want? Knowing that I am working in Swift.</p>
  
  <p>...... Later updating of the post .......</p>
  
  <p>Following examples I have found on the net; here is some code I have put together as a trial to start with.</p>
  
  <pre><code>let getUsersRequest = AWSCognitoIdentityProviderListUsersRequest()
  
  getUsersRequest?.attributesToGet = ["email"]
  getUsersRequest?.userPoolId = "MY-POOL-ID"
  getUsersRequest?.filter = "sub = \"SOME-USER-SUB\""
  
  AWSCognitoIdentityProvider(forKey: "MY-POOL-ID").listUsers(getUsersRequest!,completionHandler: {
      (response, error) in
      print("OK, Here we are!")
  })
  </code></pre>
  
  <p>But I never see the message: <em>OK, Here we are!</em></p>
  
  <p>So I must be doing something wrong. Of course MY-POOL-ID and SOME-USER-SUB are real data that I take from my AWS console.</p>