Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get IdentiyID all users from Admin Queries #5177

Closed
apoorvmote opened this issue Mar 24, 2020 · 8 comments
Closed

How to get IdentiyID all users from Admin Queries #5177

apoorvmote opened this issue Mar 24, 2020 · 8 comments
Labels
Auth Related to Auth components/category question General question

Comments

@apoorvmote
Copy link

Which Category is your question related to?
Auth, Storage

What AWS Services are you utilizing?
Cognito, AWS AppSync, Lambda, Storage

Provide additional details e.g. code snippets
as mentioned in #2203 I need each users IdentityID to just to read protected images stored in S3.

It also mentions that you can get current user's IdenitityID by

const cred = await Auth.currentCredentials()

console.log('Identity Id', cred.identityId)

But how do I get IdentityID after I listUsers from admin queries?

@apoorvmote apoorvmote added the question General question label Mar 24, 2020
@kylekirkby
Copy link

Any update on this? I also need to get the users identity id... I can't retrieve a users protected file from s3 without it...

@amhinson amhinson added the Auth Related to Auth components/category label Oct 20, 2020
@myfairshare
Copy link

I'm wondering about this also, in my case users upload a pdf file to the protected folder, but if I want users to be able to let other users view these docs then I need their identityId. Otherwise I could use public but I dont want to use public. Is this something I could do in my statements. Or should I save the users identityId to my user model and go about it this way, thank you.

@silasmahler
Copy link

Any updates on this?

@ingwinlu
Copy link

ingwinlu commented Jun 15, 2021

It is really a shame there is no easy way to do this. Retrieving the identityId ranges from a chore to downright unpractical.
Or am I missing an easy way to get it in an lambda where you would also call admin get users?

@hkjpotato
Copy link
Contributor

hkjpotato commented Jul 27, 2021

Does the list-identities call help to address the issue? https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/list-identities.html

It does not provide you the 1-1 mapping between a user in user pool and its identity id in identity pool, but it can help polling for all the identities (paginated) in an identity pool.

@abdallahshaban557
Copy link
Contributor

Hi @apoorvmote - does the solution mentioned by @hkjpotato provide you with what you need? This might be something we should expend on our admin APIs provided by the CLI as well. https://docs.amplify.aws/cli/auth/admin/#admin-queries-api

@tannerabread tannerabread added the pending-triage Issue is pending triage label Dec 20, 2022
@stocaaro stocaaro removed the pending-triage Issue is pending triage label Apr 5, 2023
@soulcubby
Copy link

I'm surprised that this is 2 years old. I am using Cognito. My use case is that User A has uploaded an asset to S3 and User B, related to User A, needs to access it. Do I understand correctly that I need to track the IdentityID of every User and check for permissions at the application-level in order to accomplish that?

@nadetastic
Copy link
Contributor

Hi @soulcubby we are currently tracking this as a feature request with Cognito on #54, so I'll go ahead and close this issue in favor of #54.

Thanks!

@nadetastic nadetastic closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auth Related to Auth components/category question General question
Projects
None yet
Development

No branches or pull requests