# Two Discourses with SSO: avoid admin/moderator sync

**URL:** https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146
**Category:** Support
**Created:** [April 15, 2019, 7:02pm UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146 "2019-04-15T19:02:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 15, 2019, 7:02pm UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146/1 "2019-04-15T19:02:09Z")

</div>

We have two Discourses set up, where one uses SSO against the other one.  
However, we do not want to synchronize admin and moderator privs, but they are synced every time a user logs in on the SSO client forum.

`sso_overrides_groups` has been disabled. It does not seem to work for admin and moderator privileges, when I look at the code those are implemented separately ([https://github.com/discourse/discourse/blob/master/app/models/discourse\_single\_sign\_on.rb#L78-L102](https://github.com/discourse/discourse/blob/master/app/models/discourse_single_sign_on.rb#L78-L102))

Is this by design, or is this a bug? Does anyone know a way around this?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 15, 2019, 11:44pm UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146/2 "2019-04-15T23:44:17Z")

</div>

Any thoughts on this @sam?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 16, 2019, 12:07am UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146/3 "2019-04-16T00:07:39Z")

</div>

We are going to need 2 extra site settings here:

> <https://github.com/discourse/discourse/blob/74c4ef6b5019b110819c24a4df8efc2b7e87ebd5/app/controllers/session_controller.rb#L62-L64>

```plaintext
sso_provider_include_groups
sso_provider_include_staff_flags

```

I think the default is correct though.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [September 4, 2019, 5:55pm UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146/4 "2019-09-04T17:55:15Z")

</div>

Is a PR for this still welcome @sam ?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 14, 2019, 11:04pm UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146/5 "2019-09-14T23:04:04Z")

</div>

Yes, I support adding something here, it will clearly have to live on the consumer side. I do struggle a bit with naming though.

`sso_sync_staff`, `sso_sync_groups` maybe? Trouble with `sso_sync_groups` is that there is naming clash with sso\_overrides\_groups.

So maybe instead we go with `sso_incoming_scopes` with a default of `staff,groups...` then you can select which incoming scopes you allow.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 21, 2023, 6:35pm UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146/6 "2023-04-21T18:35:03Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 30, 2023, 10:22am UTC](https://meta.discourse.org/t/two-discourses-with-sso-avoid-admin-moderator-sync/115146/7 "2023-04-30T10:22:22Z")

</div>


