How to get user attributes (username, email, etc.) using cognito identity id

后端 未结 7 785
不思量自难忘°
不思量自难忘° 2020-12-08 06:28

I have AWS Cognito Identity Pool that is configured with Cognito User Pool as an authentication provider.

Assume I have identity ID of an identity in Cognito Identit

相关标签:
7条回答
  • 2020-12-08 07:27

    AWS cognito-idp list-users has a filter option that allows you to filter based on attribute. 'sub' is the attribute that matches the identity id you are describing.

    e.g. at the command line:

    aws cognito-idp list-users --user-pool-id us-east-1_abcdFghjI --filter "sub=\":XXaXcXXa-XXXX-XXXX-XXX-XXXXXXXXXXXX\""
    

    This also requires the user-pool-id, which I suspect you have. Additionally, I have no idea how this is implemented or how it performances when filtering a large number of users, but I take custom attributes not being usable in filters as a hint that there is some form of indexing behind the curtain.

    0 讨论(0)
提交回复
热议问题