# Adding an Action to return Azure AD Groups for a user logging in

**URL:** <https://community.auth0.com/t/adding-an-action-to-return-azure-ad-groups-for-a-user-logging-in/102955>\
**Category:** Get Help\
**Tags:** extensibility, actions-extensibility\
**Created:** [March 20, 2023, 8:56pm UTC](https://community.auth0.com/t/adding-an-action-to-return-azure-ad-groups-for-a-user-logging-in/102955 "2023-03-20T20:56:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris392817](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris392817/32/42704_2.png) [@chris392817](https://community.auth0.com/u/chris392817)\
**Post date:** [March 20, 2023, 8:56pm UTC](https://community.auth0.com/t/adding-an-action-to-return-azure-ad-groups-for-a-user-logging-in/102955/1 "2023-03-20T20:56:37Z")

</div>

I have an Azure AD enterprise connection already setup and it working great. When I look at my user raw json data I also see that it has synced my Azure AD groups into my profile.

How do I get these groups into an id\_token with an Action? I’ve seen some old answers using Rules but nothing with Actions.

I’ve tried a ton of things already and can’t seem to figure it out.

Thanks

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 20, 2023, 10:06pm UTC](https://community.auth0.com/t/adding-an-action-to-return-azure-ad-groups-for-a-user-logging-in/102955/3 "2023-03-20T22:06:07Z")

</div>

Hi @chris392817,

Thanks for reaching out to the Auth0 Community!

> [@chris392817](#):
>
> How do I get these groups into an id\_token with an Action? I’ve seen some old answers using Rules but nothing with Actions.

Unfortunately, it is not possible to get groups in Actions. Instead, you must use Rules to get the top-level IdP attributes.

See [How to access user.groups in Actions?](https://community.auth0.com/t/how-to-access-user-groups-in-actions/84498) for more information.

Please let me know if you have additional questions.  
Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![chris392817](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris392817/32/42704_2.png) [@chris392817](https://community.auth0.com/u/chris392817)\
**Post date:** [March 23, 2023, 2:08am UTC](https://community.auth0.com/t/adding-an-action-to-return-azure-ad-groups-for-a-user-logging-in/102955/4 "2023-03-23T02:08:24Z")

</div>

Thank you for the quick reply. I got it working with Rules.

---

<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:** [April 6, 2023, 2:08am UTC](https://community.auth0.com/t/adding-an-action-to-return-azure-ad-groups-for-a-user-logging-in/102955/5 "2023-04-06T02:08:43Z")

</div>

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