# How to Authenticate users through an organization? (Auth0)

**URL:** <https://community.auth0.com/t/how-to-authenticate-users-through-an-organization-auth0/114164>\
**Category:** Get Help\
**Tags:** organizations-management-api, management-api\
**Created:** [August 21, 2023, 9:23pm UTC](https://community.auth0.com/t/how-to-authenticate-users-through-an-organization-auth0/114164 "2023-08-21T21:23:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nonameroses](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nonameroses/32/50099_2.png) [@nonameroses](https://community.auth0.com/u/nonameroses)\
**Post date:** [August 21, 2023, 9:23pm UTC](https://community.auth0.com/t/how-to-authenticate-users-through-an-organization-auth0/114164/1 "2023-08-21T21:23:52Z")

</div>

I understand I need to append the claim in the token to be able to receive org\_id.  
Question is - should I append it to the ID token or Access token? in the auth0 docs it is appended to both - [Work with Tokens and Organizations](https://auth0.com/docs/manage-users/organizations/using-tokens#authenticate-users-through-an-organization)

Then next question is, how do I actually append it to the token(s)? I have created the organisation, enabled required settings, added roles and permissions through the dashboard, yet I think the last bit what is missing is to create a custom action I assume ?

I tried this example but no luck - [How to add Roles and Permissions to the ID Token using Actions?](https://community.auth0.com/t/how-to-add-roles-and-permissions-to-the-id-token-using-actions/84506)

any ideas?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 22, 2023, 12:58am UTC](https://community.auth0.com/t/how-to-authenticate-users-through-an-organization-auth0/114164/3 "2023-08-22T00:58:39Z")

</div>

Hello @nonameroses welcome to the community!

> [@nonameroses](#):
>
> Then next question is, how do I actually append it to the token(s)? I have created the organisation, enabled required settings, added roles and permissions through the dashboard, yet I think the last bit what is missing is to create a custom action I assume ?

If you auth a user through an organization either by adding the `org_id` as a param [in the authorize request](https://community.auth0.com/t/authenticating-users-through-a-specific-organization/84679) OR by relying on the organization picker built into [Universal Login](https://auth0.com/docs/manage-users/organizations/login-flows-for-organizations) then the `org_id` is automatically added as a claim to both the access and ID tokens.

Are you also looking to add roles and permissions to tokens?

Let us know!

---

<div class="post-metadata">

**Author:** ![nonameroses](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nonameroses/32/50099_2.png) [@nonameroses](https://community.auth0.com/u/nonameroses)\
**Post date:** [August 22, 2023, 2:58pm UTC](https://community.auth0.com/t/how-to-authenticate-users-through-an-organization-auth0/114164/4 "2023-08-22T14:58:04Z")

</div>

Hi,  
how do I add the org\_id as a param in authorize request?

I forked out from this angular auth0 example [GitHub - auth0-developer-hub/spa\_angular\_typescript\_hello-world at basic-authentication-with-api-integration](https://github.com/auth0-developer-hub/spa_angular_typescript_hello-world/tree/basic-authentication-with-api-integration)

yet I fail to find the part where the param is actually built. unless it is in set-env.ts which is what I tried adding to, but had no luck.

And yes I do use Universal Login, however, it did not automatically added claim to my tokens for some reason ? Like I mentioned before I do have an Organisation created, and along with it I created some permissions and roles. I have assigned a role/persmissions to my user as well, however, in my token I can’t see the permissions/roles either.

Some screen shots -  
[![](https://pasteboard.co/v0NshgWID6Hx.png) ](https://pasteboard.co/v0NshgWID6Hx.png)

[![](https://pasteboard.co/dPe5zepxIEJr.png) ](https://pasteboard.co/dPe5zepxIEJr.png)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 22, 2023, 8:09pm UTC](https://community.auth0.com/t/how-to-authenticate-users-through-an-organization-auth0/114164/5 "2023-08-22T20:09:52Z")

</div>

> [@nonameroses](#):
>
> how do I add the org\_id as a param in authorize request?

This would be added in [AuthorizationParams](https://auth0.github.io/auth0-angular/interfaces/AuthorizationParams.html#organization).

> [@nonameroses](#):
>
> And yes I do use Universal Login, however, it did not automatically added claim to my tokens for some reason ?

What does the flow look like when you log a user in? At some point does the user choose which organization to login to?

> [@nonameroses](#):
>
> I have assigned a role/permissions to my user as well, however, in my token I can’t see the permissions/roles either.

Are you passing an `audience` param anywhere? The sample you’ve linked to doesn’t look to include an `audience` by default either - This will need to match the identifier of the API where you have toggled RBAC and to include permissions in the access token.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 5, 2023, 8:10pm UTC](https://community.auth0.com/t/how-to-authenticate-users-through-an-organization-auth0/114164/6 "2023-09-05T20:10:08Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
