# 根据 SSO 负载中的信息设置用户标题（组？）

**URL:** <https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754>\
**Category:** SSO\
**Created:** [2019 年7 月 1 日 09:44 UTC](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754 "2019-07-01T09:44:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![thsnyzkn](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thsnyzkn](https://meta.discourse.org/u/thsnyzkn)\
发布日期： [2019 年7 月 1 日 09:44 UTC](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754/1 "2019-07-01T09:44:00Z")

</div>

抱歉，如果标题对这里的各位不够清晰的话。我相对刚接触整个 Discourse 系统，还无法完全理解这些新术语。

我已经成功在我的外部网站配置了 SSO。我现在想要实现的是，根据我外部网站中存在的不同用户类型，自动为用户分配头衔。

在这个话题中，我想这里已经解释了相关内容，但我还是不太明白这里提到的“通过 SSO 进行群组归属”具体指什么。

> [@sam](#):
>
> ### 指定群组归属
> 
> 如果指定了 _SSO 覆盖群组_ 选项，Discourse 将考虑 `groups` 中传递的以逗号分隔的群组列表。
> 
> ![image.png](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/0/9/091c37716d856829b67c9c3764eca1412831ceba.png)
> 
> 除了 `groups` 之外，无论是否指定 _SSO 覆盖群组_ 选项，您都可以在 SSO 载荷中使用 `add_groups` 和 `remove_groups` 属性来指定群组归属。
> 
> `add_groups` 是一个以逗号分隔的群组名称列表，系统将确保用户属于这些群组。  
> `remove_groups` 是一个以逗号分隔的群组名称列表，系统将确保用户 **不** 属于这些群组。

假设我的外部网站有四种不同的用户类型，我希望在我的论坛网站中，通过相同的分组系统自动将它们归类。例如，在这个论坛中，有一些用户头衔如“团队”、“普通用户”等。我是否需要创建一个新的自定义字段，或者创建群组，又或者需要在发往论坛的 SSO 链接中指明？

任何帮助都将不胜感激。

---

_[View the full topic](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754)._
