# Setting the user title(group?) based on the information that is coming from the sso payload

**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:** [July 1, 2019, 9:44am 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:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![thsnyzkn](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thsnyzkn](https://meta.discourse.org/u/thsnyzkn)
#### Post date: [July 1, 2019, 9:44am 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>

Sorry about the title, if it’s unclear for the folks here. I am relatively new to whole Discourse system and I couldn’t wrap my head around with all these new terminologies.

I managed to setup SSO with my external site. What I am trying to achieve right now is to assign titles to the users automatically based on the different user types that are exist in my external website.  
Here, in this topic, it’s, I guess, explained, but I couldn’t understand what is implied here by group membership with SSO.

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045/1):
>
> ### Specifying group membership
> 
> If the _sso overrides groups_ option is specified, Discourse will consider the comma separated list of groups passed in `groups` .
> 
> ![image.png](https://global.discourse-cdn.com/meta/original/3X/0/9/091c37716d856829b67c9c3764eca1412831ceba.png)
> 
> Aside from `groups` , you may also specify group membership in your SSO payload using the `add_groups` and `remove_groups` attributes regardless of the _sso overrides groups_ option.
> 
> `add_groups` is a comma delimited list of group names we will ensure the user is a member of.  
> `remove_groups` is a comma delimited list of group names we will ensure the user is **not** a member of.

Let’s say there are four different user types in my external website, and in my forum website I want them to be grouped with the same grouping system automatically. For example, in this forum there are some user titles like team,regular etc. Do I need to create a new custom field, or do I need to create groups or indicate within the incoming SSO link to forum?

Any help would really be appreciated.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 1, 2019, 12:13pm UTC](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754/2 "2019-07-01T12:13:46Z")

</div>

Just see that sso passes the groups. There is a group setting that will allow them to be “primary” groups, which get displayed next to the username. See also “flair” which will give them a little icon in their avatar.

---

<div class="post-metadata">

### Author: ![thsnyzkn](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thsnyzkn](https://meta.discourse.org/u/thsnyzkn)
#### Post date: [July 1, 2019, 12:16pm UTC](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754/3 "2019-07-01T12:16:51Z")

</div>

Thanks for the reply, but I couldn’t find the “primary” or “flair” options.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 1, 2019, 12:59pm UTC](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754/4 "2019-07-01T12:59:11Z")

</div>

Perhaps they are hidden behind some tabs? I found them on my phone. This is under manage /interaction

```
 Automatically set as primary group

```

Flair is under profile.

---

<div class="post-metadata">

### Author: ![thsnyzkn](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thsnyzkn](https://meta.discourse.org/u/thsnyzkn)
#### Post date: [July 1, 2019, 1:00pm UTC](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754/5 "2019-07-01T13:00:17Z")

</div>

Thanks a lot, I figured it out.

---

<div class="post-metadata">

### Author: ![Cardinalflyer](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Cardinalflyer](https://meta.discourse.org/u/Cardinalflyer)
#### Post date: [July 18, 2019, 3:14pm UTC](https://meta.discourse.org/t/setting-the-user-title-group-based-on-the-information-that-is-coming-from-the-sso-payload/121754/6 "2019-07-18T15:14:47Z")

</div>

Since I just went down this same road, to help a future new person who may be puzzled for a moment…

Inside the User → Group settings, within a chosen group, under Membership, there is a checkbox for ‘Automatically set as primary group’. Presumably only one group can have this attribute set, but I have not tested that detail…
