# 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="/files/N7hwGbxOkwWudkkMA7ck" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.portainer.io/sts/faqs/known-issues/groups-info-issue-with-oauth-using-microsoft-ad.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
