Get organization id from user login

Hi !
I´m trying to login a user and after login get the organization ID. Let me explain it:

  1. I want to use a custom domain for my login.
  2. When the user enter the email and password, if its correct then get the token.
  3. In the token I want the roles, the permissions and the organizationID.

I want to do it without enter any type of organizationID in the code, and without let the user select an organization. My users can´t have one email in 2 or more differents organizations, user just can be in 1 organization.

I search info about this and I found that Auth0 need a context for get the organization claim, and I want to just with email and passwd get the organization of the user, how can I do that ?

Cheers ! ^^

Hi @a19daniellr ,

Welcome to the Auth0 Community!

Could you please check if the solution in this topic helps? Thanks!

Hi lihua.zhang,
Thanks for answer me!
I tried that solution but I have to pass OrganizationID like a parameter in the URL request, for example:
But I dont want that, I want to login user without passing any parameter for the organization and when the user log in, I can easly get a token with OrgID.
I dont know if I explain me well, do I?

Thank you for the details.

Right now, we can not get organization in a token without logging-in in the context of an organization.

Could you please check this feedback and click on Vote if it applies to your use case? Otherwise, please communicate directly to our product team using our feedback page and click on the Vote button. Thank you!


Hi @a19daniellr .

Were you able to find a solution or a reasonable workaround for this?

1 Like