Cognito User Pool API - Get user by sub / user ID / UUID

0

Hi, we want to integrate our service with Cognito user pools, where our data store uses the user ID as the primary key. However, I've learned that Cognito's AdminGetUser method retrieves users by their username. The only way that I'm able to query Cognito to retrieve a user's information by their user ID, is to use ListUsers with a filter for the specific user ID.

Is there really no way to retrieve a user's information by the user ID? If not, then our data store would need to store PII, or we would need to find some other workaround. We're looking to avoid these outcomes.

2개 답변
0

AWS Cognito doesn't have a direct method to retrieve user information using the user ID. The workarounds include using the ListUsers method with a filter for the specific user ID, or the GetUser method with an Access Token.

https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html

profile picture
전문가
답변함 4달 전
0

Hello, can you describe what you're looking to achieve in a little more detail? It sounds like you want to store only the the sub attribute for a user, and then be able to query their full details using that identifier. The sub attribute is the unique identifier for each user. This should be achievable using the ListUsers API together with the sub as a filter.

You describe this in your question, is there a reason this approach isn't sufficient?

AWS
답변함 4달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인