# Restrict Office 365 Login to certain Group

**URL:** https://meta.discourse.org/t/restrict-office-365-login-to-certain-group/195377
**Category:** Extras
**Created:** [June 29, 2021, 3:49pm UTC](https://meta.discourse.org/t/restrict-office-365-login-to-certain-group/195377 "2021-06-29T15:49:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Rene.Rohner](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rene.rohner/32/222524_2.png) [@Rene.Rohner](https://meta.discourse.org/u/Rene.Rohner)
#### Post date: [June 29, 2021, 3:49pm UTC](https://meta.discourse.org/t/restrict-office-365-login-to-certain-group/195377/1 "2021-06-29T15:49:48Z")

</div>

Is it possible to restrict the Office 365 Login Plugin to only allow users from a specific Organization and within this organization to a specific Group?

In the Docs it is written, that we must choose the `the most permissive option`.

> [@Microsoft Authentication](https://meta.discourse.org/t/microsoft-identity-platform-plugin/51731):
>
> discourse Hosted by us? This plugin is available on our Business and Enterprise plans. [Amazon & Microsoft Logins | Discourse - Civilized Discussion](https://www.discourse.org/plugins/amazon-microsoft-login.html)discourse2Summary Enable users to log in using their Microsoft accounts (aka Office 365 or Microsoft 365 accounts)open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Summary Microsoft Authentication enables users to log in to your Discourse forum using t…

This looks like everyone who has a Office 365 Account can log-in to the forum.  
When i switch this option to single organization, it stops working.

We need to restrict the access to a Group of users.

Cheers

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 29, 2021, 7:33pm UTC](https://meta.discourse.org/t/restrict-office-365-login-to-certain-group/195377/3 "2021-06-29T19:33:57Z")

</div>

> [@Rene.Rohner](#):
>
> This looks like everyone who has a Office 365 Account can log-in to the forum.  
> When i switch this option to single organization, it stops working.

I’ve asked our engineers about the issue. The problem is that the plugin is configured to point to the multi-tenant endpoint on Office 365. The suggested workaround is that since Office 365 is the same as Azure AD, the Discourse OpenID Connect plugin can be used to point to a single tenant endpoint. Details about configuring that plugin are here: [Discourse OpenID Connect (OIDC)](https://meta.discourse.org/t/openid-connect-authentication-plugin/103632). Have a look at the Azure AD entry in that topic’s Provider Specific Notes section for details about how to set this up.

If anyone has run into issues with using the OpenID Connect plugin in place of the Office 365 plugin, please let us know.
