# Transforming usernames with SSO

**URL:** https://meta.discourse.org/t/transforming-usernames-with-sso/140184
**Category:** Support
**Created:** [January 30, 2020, 4:22pm UTC](https://meta.discourse.org/t/transforming-usernames-with-sso/140184 "2020-01-30T16:22:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hollyw](https://avatars.discourse-cdn.com/v4/letter/h/4da419/32.png) [@hollyw](https://meta.discourse.org/u/hollyw)
#### Post date: [January 30, 2020, 4:22pm UTC](https://meta.discourse.org/t/transforming-usernames-with-sso/140184/1 "2020-01-30T16:22:12Z")

</div>

Our team’s Discourse forum uses SSO. Sometimes, users have aliased accounts that read as `john_smith+lab@company.com`, and so in Discourse the username appears as `john_smith_lab`.

It’s a bit awkward to have so many usernames that are inconsistent with these aliases (we have a lot of different ones), so we were trying to figure out if there’s a way to alter/transform these usernames before or when they’re created in Discourse.

For example, since we do all our aliases with the `+` symbol, if there’s a way to truncate everyone’s username from the `+` onward, then that would allow us to normalize everyone’s username to a `first_last` state.

Is this something that’s possible? If so, how would we go about doing it?

---

<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: [January 30, 2020, 5:54pm UTC](https://meta.discourse.org/t/transforming-usernames-with-sso/140184/2 "2020-01-30T17:54:38Z")

</div>

> [@hollyw](#):
>
> Our team’s Discourse forum uses SSO.

I think the solution is to configure your SSO so that it sends a reasonable username. Aren’t those usernames that you don’t like sent to Discourse by your SSO? Also, if `sso overrides username` is un-checked, then users can change their username (within some limits that are configurable).

---

<div class="post-metadata">

### Author: ![hollyw](https://avatars.discourse-cdn.com/v4/letter/h/4da419/32.png) [@hollyw](https://meta.discourse.org/u/hollyw)
#### Post date: [January 30, 2020, 6:55pm UTC](https://meta.discourse.org/t/transforming-usernames-with-sso/140184/3 "2020-01-30T18:55:23Z")

</div>

If we uncheck `sso overrides username`, are the username change limitations referring to things like min/max length and allowed unicode characters? I see those, but I want to make sure I’m not missing other major configuration options.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 30, 2020, 6:58pm UTC](https://meta.discourse.org/t/transforming-usernames-with-sso/140184/4 "2020-01-30T18:58:48Z")

</div>

You shouldn’t change any settings from default and send the appropriate username in the SSO payload. Our [Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045) topic covers that.

---

<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: [February 29, 2020, 7:00pm UTC](https://meta.discourse.org/t/transforming-usernames-with-sso/140184/5 "2020-02-29T19:00:51Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
