I see that if I use Auth.currentUserInfo() from aws-amplify in the client, I get an object containing a username. The same username as I see in the Cognito User Pool table of users.
So my questions are:
What is the difference between Cognito Identity ID and Username? When to use one or another?
How do I map the Cognito Identity ID to a username? If I look up the Cognito Idendity ID in my User Pool table of users, I’m not able to find anything. Here only the username is present. How is it mapped?
Yeah there isn’t a super simple way to get this mapping (at least the last time I checked). We talked about this in some other thread but basically your Lambda functions have the Cognito User Pool User Id) passed to them in the event object.
Thanks jayair, this was very helpful. I’d been looking for how to find the cognito user id of the current user, and then their cognito email address and other attributes. This code snippet alone could be a complete article (it prob is and I just missed it).