# Groups info issue with OAuth using Microsoft AD

{% hint style="info" %}
**Affected versions:** 2.14.2 and previous

**Fixed in:** 2.15.0 and above
{% endhint %}

#### Issue Description

If you have configured OAuth using Microsoft AD in Portainer and trying to use Automatic Team membership you may run into an issue where group membership information is not returned correctly and users are not populated into the correct teams in Portainer.

#### Fix

Update Portainer to 2.15.0 or above.

#### Workaround

In OAuth Config, use the following URL for Resource URL (replace the existing graph.windows.net URL)

```
https://login.microsoftonline.com/<tenant ID>/openid/userinfo
```

User Identifier: unique\_name\
Scopes: openid profile

You will also need to have following permissions on your App Registration in Azure:

<figure><img src="https://3850702872-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXI7douejaBgpZ6CP2zJf%2Fuploads%2Fgit-blob-41f5582949be0b604d996bea4e57346bb782fbb5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
