# Sync User Record with Username Case Changes

**URL:** https://meta.discourse.org/t/sync-user-record-with-username-case-changes/33114
**Category:** Bug
**Created:** [September 11, 2015, 7:12am UTC](https://meta.discourse.org/t/sync-user-record-with-username-case-changes/33114 "2015-09-11T07:12:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![FrankG](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankg/32/116677_2.png) [@FrankG](https://meta.discourse.org/u/FrankG)
#### Post date: [September 11, 2015, 7:12am UTC](https://meta.discourse.org/t/sync-user-record-with-username-case-changes/33114/1 "2015-09-11T07:12:50Z")

</div>

Hello,

I’m having trouble getting SSO records to sync properly when the user changes only the case of their username. If the target user is named Sam, and a sync record comes in changing the username to SaM (using Sam’s external ID and email), Discourse seems to be renaming the account to SaM1. Any ideas?

Also, in the SSO section of the user in the admin panel, it shows the correct, new username.

Thanks guys

---

<div class="post-metadata">

### Author: ![FrankG](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankg/32/116677_2.png) [@FrankG](https://meta.discourse.org/u/FrankG)
#### Post date: [October 20, 2015, 4:35am UTC](https://meta.discourse.org/t/sync-user-record-with-username-case-changes/33114/2 "2015-10-20T04:35:47Z")

</div>

Bumping this because it’s still an issue.

---

<div class="post-metadata">

### Author: ![FrankG](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankg/32/116677_2.png) [@FrankG](https://meta.discourse.org/u/FrankG)
#### Post date: [October 29, 2015, 2:35pm UTC](https://meta.discourse.org/t/sync-user-record-with-username-case-changes/33114/3 "2015-10-29T14:35:43Z")

</div>

@sam @eviltrout @codinghorror Any ideas?

---

<div class="post-metadata">

### Author: ![andrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrei/32/205142_2.png) [@andrei](https://meta.discourse.org/u/andrei)
#### Post date: [October 7, 2021, 4:12pm UTC](https://meta.discourse.org/t/sync-user-record-with-username-case-changes/33114/5 "2021-10-07T16:12:30Z")

</div>

I’m closing this, this was fixed several years ago:

[https://github.com/discourse/discourse/commit/3c3d2051807b8db5726e18238384e435aa9191b7](https://github.com/discourse/discourse/commit/3c3d2051807b8db5726e18238384e435aa9191b7)

Here we have a test case for this:

> <https://github.com/discourse/discourse/blob/aa00960638bf6a67836ac838ffac17a539c942b9/spec/models/discourse_single_sign_on_spec.rb#L267>

---

<div class="post-metadata">

### Author: ![andrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrei/32/205142_2.png) [@andrei](https://meta.discourse.org/u/andrei)
#### Post date: [October 7, 2021, 4:12pm UTC](https://meta.discourse.org/t/sync-user-record-with-username-case-changes/33114/6 "2021-10-07T16:12:49Z")

</div>


