# Synchronize AD Groups to Gitea Teams

**URL:** <https://forum.gitea.com/t/synchronize-ad-groups-to-gitea-teams/9636>\
**Category:** Install/Maintain/Configure\
**Created:** [August 26, 2024, 2:10pm UTC](https://forum.gitea.com/t/synchronize-ad-groups-to-gitea-teams/9636 "2024-08-26T14:10:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndu\_06](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@ndu\_06](https://forum.gitea.com/u/ndu_06)\
**Post date:** [August 26, 2024, 2:10pm UTC](https://forum.gitea.com/t/synchronize-ad-groups-to-gitea-teams/9636/1 "2024-08-26T14:10:29Z")

</div>

Hello,

I’m using Gitea 1.20.4 on RHEL 8.8.  
I have configured an Authentication Source with Active Directory.

In it, I have a user filter that works : (&(memberOf=CN=G\_GITEA\_USER,CN=Users,DC=DOMAIN,DC=LAN)(sAMAccountName=%s)).

I have also configured synchronization between AD Groups and Gitea Teams so that if we add someone to one of the groups, he will be added to the associated team.

But the thing I can’t get to work is when we remove someone from one of the groups, he is also removed from the associated team.

Group Search Base DN : CN=Users,DC=DOMAIN,DC=LAN  
Group Attribute Containing List Of Users : member  
User Attribute Liste In Group : distinguishedName  
Verify group membership in LDAP : I leave it empty because I don’t know how to configure it.  
“Remove users from synchronized teams if the user doesn’t belong to the corresponding group” case checked (sorry if it’s not the actual name of this checkbox, I use the french version of Gitea).

Did I miss something ?

Thanks !

---

<div class="post-metadata">

**Author:** ![ndu\_06](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@ndu\_06](https://forum.gitea.com/u/ndu_06)\
**Post date:** [August 27, 2024, 1:27pm UTC](https://forum.gitea.com/t/synchronize-ad-groups-to-gitea-teams/9636/2 "2024-08-27T13:27:34Z")

</div>

I have made some tests and I can clarify what’s OK et what’s not.

If I remove someone from an access group of a repository, after the Gitea sync, he is removed from the associated team. That’s one of the expected result.

But if I remove someone from the G\_GITEA\_USER group (the one used for the user filter) without removing it from the access groups before, he still appear in the associated teams. Luckily, he is disabled and can’t access Gitea.

So my new question is : Is there a way to remove a user from all the teams is in if he is removed from the G\_GITEA\_USER group or if he is deleted on the AD side ?

Thanks.
