I have a hybrid mobile app uses the AWS Javascript SDK to integrate with Amazon Cognito, using a Cognito user pool as the Identity Provider. It works.
I need to traverse the data using the AWS API to produce a report. A key part is listing which user (showing their username) is associated with which items (associated with their Cognito identity).
The Problem
I have a list of Cognito Identities from ListIdentities
. I have a list of users in the Cognito User Pool from ListUsers
. What links the Identity to the User?
I've tried...
This answer says the User's sub
field is their IdentityId. Iterating through, no subs match any IdentityId values.
I thought the answer was in Cognito Identity's DescribeIdentity
. This returns a map of Logins
- which I expected to be an array of User IDs associated with this Identity. However it returns a map containing 1 URL (the URL of my User pool), which doesn't map to the user.
["Logins"]=>
array(1) {
[0]=>
string(55) "cognito-idp.eu-west-1.amazonaws.com/eu-west-1_*********"
}
How can I navigate the API from the Identity to the user, or vice versa?