# Change email for SSO user?

**URL:** https://meta.discourse.org/t/change-email-for-sso-user/32010
**Category:** SSO
**Created:** [8월 12, 2015, 4:42오전 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010 "2015-08-12T04:42:37Z")
**Posts on this page:** 16
**Page:** 2

<div class="post-metadata">

### Author: ![Peter\_Backgren](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peter_backgren/32/66263_2.png) [@Peter\_Backgren](https://meta.discourse.org/u/Peter_Backgren)
#### Post date: [7월 4, 2017, 4:12오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/23 "2017-07-04T16:12:22Z")

</div>

Obviously I’m testing with several accounts I created just for this purpose (using virtual machines and other browsers _and_ too much time testing 😉 ).

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [7월 12, 2017, 11:26오전 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/24 "2017-07-12T11:26:32Z")

</div>

I think I resolved the issue on my end. It had nothing to do with Discourse.

There’s a bit of code in my site’s footer that checks – for users whose email has been verified – if they are logged in to Discourse already and, if they aren’t, logs them in. This informs Discourse of users’ info, even if they don’t visit the forum itself.

 ![](https://global.discourse-cdn.com/meta/original/3X/5/c/5c0ad20e046faf8ede7299c8f2f64834ccb2e064.png)

Alas, this chunk was being accidentally cached so, of course, it wasn’t firing because it had been cached when no user had logged in. My bad! 😊

---

<div class="post-metadata">

### Author: ![Peter\_Backgren](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peter_backgren/32/66263_2.png) [@Peter\_Backgren](https://meta.discourse.org/u/Peter_Backgren)
#### Post date: [10월 9, 2017, 1:58오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/25 "2017-10-09T13:58:44Z")

</div>

This is probably the best place still to mention that there are cases when Discourse drives me absolutely nuts.

I happen to have several “users” that are not real. Whether they are read-only accounts for a specific hidden category, anonymous beyond the capabilities of Discourse or whatever should not matter. Some of these are automatic and created on the fly as needed (and reused in a queue).

Problem is, they have been added using a “noreply” email. That email does not exist anymore so Discourse is spamming out admin mails saying this email bounced, all the time, for each of these users and the moderators are now starting to go nuts.

Now, if I go in and change that email to an existing no-forward, no-store email, Discourse refuses to do it without sending a mail to said email asking for confirmation… so no changes are made. Anyone see the problem here? 😃

So I have two options I can think of:

Log in as each user using SSO to force an email change (which hopefully does not require confirmation, haven’t actually tried, would be too tedious).

Go to the preferences of each such user and change email notifications and summary digests to never, ever. And every time a new temporary user gets created, I need to remember to do the same.

Maaaaan. If I as an admin change an email for a user, there is no need to ask the user to confirm the email. Any user will hopefully contact me if I actually messed up which is very unlikely. Besides, these days I just let the users change their emails at will, less trouble for a poor admin. And I understand there is a risk that the user will never be able to login or notify anyone again but obviously they can mail the site help as such.

---

<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: [10월 9, 2017, 8:59오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/26 "2017-10-09T20:59:51Z")

</div>

Why not use the sync\_sso endpoint to fix all the emails via api?

---

<div class="post-metadata">

### Author: ![Peter\_Backgren](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peter_backgren/32/66263_2.png) [@Peter\_Backgren](https://meta.discourse.org/u/Peter_Backgren)
#### Post date: [10월 12, 2017, 3:54오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/27 "2017-10-12T15:54:50Z")

</div>

Not sure what you mean by this. Are you talking about the setting “sso overrides email”?

That would only take effect when/if the user actually logs in. So emails would still bounce while the email is wrong.

If you are possibly talking about “POST admin endpoint /admin/users/sync\_sso to synchronize an SSO record” that would mean I would have to force one or all users from the SSO software I guess. Given the problems with SSO emails syncing it’s not the first option I would try.

Anyway, because of the problem described earlier in this topic I now have “sso overrides email” off and let users change their emails themselves. So I don’t want to override from SSO anymore.

But all this is missing the point, that the _users bouncing mails are generated on the fly_, as needed. The easiest way would be to allow a change to the email **without** authentication (at least for admins - or admins would have a choice).

_Side note_: I have tried giving an empty email address but the system does not allow for that. I understand the email address is so critical is should not be empty. BUT, if you really give an empty email (at least as an admin), one could assume you **know** what you are doing.

Just to confuse things more, I _actually have_ users that _do not_ have an email account, only access to a browser. Think refugees here and you might understand why. It is far easier to just allow someone to login and read instructions in their own language than to try and explain to them they need to make a gmail account or something.

In any case, this is theoretical, I doubt many people have the same problem. I would say it’s simply too strict even for admins, IMHO.

(sorry about the reply time, with more free time the world would be perfect)

---

<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: [10월 12, 2017, 4:05오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/28 "2017-10-12T16:05:40Z")

</div>

> [@Peter\_Backgren](#):
>
> The easiest way would be to allow a change to the email without authentication (at least for admins - or admins would have a choice).

That would allow someone to hijack an admin’s account without their knowing. Though your edge case for users without access to email makes some sense, it seems far-fetched to think that admins would be people who don’t have the ability to receive email.

---

<div class="post-metadata">

### Author: ![Peter\_Backgren](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peter_backgren/32/66263_2.png) [@Peter\_Backgren](https://meta.discourse.org/u/Peter_Backgren)
#### Post date: [10월 13, 2017, 10:41오전 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/29 "2017-10-13T10:41:06Z")

</div>

Admins have email addresses. Not sure where you got the idea they would not have (my bad writing probably 😃 ).

The case was for an admin to be able to change other user’s emails without the need to authenticate.

---

<div class="post-metadata">

### Author: ![trs80](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trs80/32/233027_2.png) [@trs80](https://meta.discourse.org/u/trs80)
#### Post date: [11월 2, 2018, 7:56오전 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/30 "2018-11-02T07:56:50Z")

</div>

So I’m trying to do this - the use case is a user has changed their email in the SSO system, however they now can’t log in since there’s another account of theirs that uses their new email address already. SSO refuses to update the email (even though we have sso\_overrides\_email on) because email addresses must be unique across accounts. I don’t want to delete the account without the SSO record as that has posts associated with it. And if I turn off sso\_overrides\_email to change the email manually, I can’t make it some broken email since Discourse insists on validating it.

I see there’s a way to [merge users](https://meta.discourse.org/t/rake-task-for-merging-users/89086) but a) it’s a rake task and we’re hosted with Discourse, do I contact support to do that? b) there’s comments about needing to swap the primary and secondary email addresses.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [12월 18, 2019, 5:57오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/31 "2019-12-18T17:57:38Z")

</div>

저도 @trs80 님과 [같은 상황](https://meta.discourse.org/t/rake-task-for-merging-users/89086/48)입니다. 병합의 이 제한 사항을 우회할 수 있는 방법이 있는지 확인해 보셨나요?

---

<div class="post-metadata">

### Author: ![trs80](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trs80/32/233027_2.png) [@trs80](https://meta.discourse.org/u/trs80)
#### Post date: [12월 19, 2019, 11:45오전 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/32 "2019-12-19T11:45:38Z")

</div>

이메일을 확인해 봐야겠지만, 지원팀은 이런 문제를 해결하는 데 대체로 꽤 잘 해주는 편이었어요.

---

<div class="post-metadata">

### Author: ![alxndr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alxndr/32/102300_2.png) [@alxndr](https://meta.discourse.org/u/alxndr)
#### Post date: [1월 15, 2024, 7:47오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/34 "2024-01-15T19:47:30Z")

</div>

> “이메일을 오버라이드로 설정하세요”

이것이 “인증이 이메일을 오버라이드한다” 설정인가요?

---

<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: [1월 16, 2024, 7:38오전 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/35 "2024-01-16T07:38:01Z")

</div>

나쁘지 않은 AI, 이 답변에 만족합니다:

> **인증 오버라이드 이메일에 대한 AI 설명
AI**
>
> **sam:**
> 
> auth overrides email은 무엇을 하는 건가요?
> 
> **gpt4\_bot:**
> 
> > **사이트 설정 컨텍스트 조회**
> >
> > 다음에 대한 컨텍스트 읽기: auth\_overrides\_email
> 
> Discourse의 `auth_overrides_email` 사이트 설정은 외부 인증 제공자와 관련하여 이메일 동작을 제어하는 역할을 합니다. 이 설정이 `true`로 설정되면 다음과 같은 동작을 수행합니다:
> 
> 1. 사용자가 로그인할 때마다 외부 인증 제공자(예: SSO, OAuth)에서 제공한 이메일 주소로 로컬 이메일 주소를 오버라이드합니다.
> 2. 사용자가 Discourse 계정 설정 내에서 로컬 이메일 주소를 변경하는 것을 방지합니다.
> 
> 이 기능은 Discourse 사이트에 구성된 모든 인증 제공자에 적용됩니다. 이 설정은 외부 서비스를 통해 로그인하는 사용자의 이메일 일관성과 신원 검증을 유지하려는 경우 유용합니다.
> 
> 그러나 로컬 이메일 주소 정규화(normalization)로 인해 불일치가 발생할 수 있으므로 이 설정을 사용할 때는 주의해야 합니다. 이는 외부 시스템과 Discourse가 이메일 주소를 형식화하거나 처리하는 방식에 차이가 있을 경우 계정 연결에 불일치나 문제가 발생할 수 있음을 의미합니다.
> 
> `auth_overrides_email`의 기본값은 `false`이며, 이는 기본적으로 Discourse가 로그인 시마다 로컬 이메일을 외부 사이트 이메일로 오버라이드하지 않고, 사용자가 이메일 주소를 변경하는 것을 방지하지도 않음을 의미합니다.
> 
> 이 설정이 활성화되면 사이트의 가디언(guardian) 및 사용자 가디언 스크립트가 관리하는 특정 경우에서 이메일 주소를 편집할 수 없는 것을 포함하여 다양한 사용자 권한에 영향을 미칩니다. 또한, 이 설정은 이메일 필드가 표시되는 방식과 사용자 인터페이스 내에서 이메일 주소 변경에 관한 지침이 사용자에게 제공되는지에 영향을 줍니다.

---

<div class="post-metadata">

### Author: ![adamengst](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamengst/32/116607_2.png) [@adamengst](https://meta.discourse.org/u/adamengst)
#### Post date: [1월 16, 2024, 10:30오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/36 "2024-01-16T22:30:56Z")

</div>

저도 여기서 문제가 있습니다. Discourse는 제 WordPress 사이트에서 SSO 정보를 가져오며, auth\_overrides\_email이 활성화되어 있습니다.

하지만 WordPress에서 사용자의 이메일 주소를 업데이트해도 Discourse에서는 아무런 변경 사항이 반영되지 않습니다.

auth\_overrides\_email을 끄어 보았지만, 인증 제공자에서 관리된다는 주석은 제거되었을 뿐, 이메일 주소 옆에 연필 아이콘이 나타나지 않았습니다. 관리자로서도, 사용자를 impersonate하여도(위에서 제안된 로그인/로그아웃을 시뮬레이션하기 위해 설정을 끄기 전에 여러 번 시도했습니다) 마찬가지였습니다. 제가 할 수 있었던 것은 주소를 표시하는 것뿐이었습니다.

auth\_overrides\_email을 다시 켜고 WordPress에서 주소를 두 번 더 변경해 보았지만(다른 것으로 바꾸었다가 원래 있어야 할 것으로 되돌리는 방식) 여전히 변경 사항이 없었습니다.

제안해 주실 수 있는 방법이 있을까요?

---

<div class="post-metadata">

### Author: ![Joseph\_Tucker1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joseph_tucker1/32/253029_2.png) [@Joseph\_Tucker1](https://meta.discourse.org/u/Joseph_Tucker1)
#### Post date: [9월 9, 2024, 6:25오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/37 "2024-09-09T18:25:06Z")

</div>

저도 같은 문제를 겪고 있습니다. Discourse 데이터베이스에서 사용자의 이메일 주소를 변경하는 방법이 있을까요? 명령줄에서 어떻게 하면 될까요?

---

<div class="post-metadata">

### Author: ![putty](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/putty/32/370902_2.png) [@putty](https://meta.discourse.org/u/putty)
#### Post date: [9월 9, 2024, 7:32오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/38 "2024-09-09T19:32:56Z")

</div>

보통 `emails_editable`를 활성화한 다음, `auth_overrides_email`를 비활성화하고, 그 후 이메일 주소를 변경해야 합니다.

---

<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: [9월 9, 2024, 8:39오후 UTC](https://meta.discourse.org/t/change-email-for-sso-user/32010/39 "2024-09-09T20:39:57Z")

</div>

로그아웃을 강제하여 다시 로그인하도록 하면, 새로운 이메일 주소가 Discourse에 전달되나요?

[이전 페이지](https://meta.discourse.org/t/change-email-for-sso-user/32010.md?page=1)
