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

Finding the userpool for a user in usermanagement service #55

Closed
s1mrankaur opened this issue Jan 15, 2021 · 2 comments
Closed

Finding the userpool for a user in usermanagement service #55

s1mrankaur opened this issue Jan 15, 2021 · 2 comments

Comments

@s1mrankaur
Copy link

We intend to have the same user in multiple tenant accounts. This means the same username/email will be mapped to multiple Cognito pool ids in user management service. How can we decide which pool to authenticate the user against when we do not want to have the users select the tenant.

@brtrvn
Copy link
Contributor

brtrvn commented Sep 22, 2021

This solution does not really support that use case. You'd either have to have your tenant's users choose which tenant they'd like their session to act under, or you'd have to have your users use different usernames for the different tenant contexts. Somehow you have to resolve which tenant they are acting as a user of for their requests against your service.

Another way to think about this is what other kind of metadata could you use to determine tenant context? For example, if you host a "vanity" subdomain for each of your tenants, then you could use that hostname as a piece of metadata in your auth system to determine what the tenant context is (and therefore which User Pool to look at). When [email protected] wants to use your service as a user of "Company A" then they'd go to company-a.example.com and when they want to use it as a user of "Company B" then they go to company-b.example.com. You can route both of those CNAMEs to the same auth entry point.

@brtrvn
Copy link
Contributor

brtrvn commented Aug 19, 2022

Duplicate of #46

@brtrvn brtrvn marked this as a duplicate of #46 Aug 19, 2022
@brtrvn brtrvn closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants