AdminGetUser only works with User Username, not Sub

0

I exec this command:

aws cognito-idp admin-get-user --user-pool-id "us-west-2_dkEwXXXXX" --username "ae163f5c-15f5-4496-XXXX-1703d45XXXXX" --profile devops

and I get

An error occurred (UserNotFoundException) when calling the AdminGetUser operation: User does not exist.

The documentation states: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminGetUser.html The username of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If username isn't an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.

THIS DOESN'T WORK!

Here is a screen shot of the user. Cognito User Page

profile picture
질문됨 한 달 전80회 조회
2개 답변
0

Looking at your screenshot, you have email mapped to user name, so that value needs to be passed in as username

aws cognito-idp admin-get-user --user-pool-id us-west-2_dkEwXXXXX --username testuser@sty-holdings.com

If you want to query by sub, use ListUsers and filter. Here is an AWS CLI example for list-users

aws cognito-idp list-users --user-pool-id us-west-2_dkEwXXXXX --filter "sub = \"ae163f5c-15f5-4496-XXXX-1703d45XXXXX\"" 
profile pictureAWS
답변함 한 달 전
profile picture
전문가
검토됨 한 달 전
0

To make sure I understand, are you saying the documentation is wrong? "If username isn't an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP." So admin-get-user does not work with sub?

Scott
답변함 한 달 전

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

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

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

관련 콘텐츠