E-Mail für SSO-Benutzer ändern?

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

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.

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! :blush:

3 „Gefällt mir“

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? :smiley:

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.

1 „Gefällt mir“

Why not use the sync_sso endpoint to fix all the emails via api?

2 „Gefällt mir“

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)

1 „Gefällt mir“

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.

2 „Gefällt mir“

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

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

1 „Gefällt mir“

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 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.

1 „Gefällt mir“

I’m in the same boat @trs80. Did you ever find out if there is a way to workaround this limitation of the merging?

I’ll have to check my email but support have generally been pretty good with resolving these issues.

2 „Gefällt mir“

„auf E-Mail-Überschreibung setzen“

Ist dies die Einstellung „auth überschreibt E-Mail“?

1 „Gefällt mir“

Nicht schlecht, KI, zufrieden mit dieser Antwort:

KI-Erklärung zu Auth-Overrides-E-Mails KI

Sam:

Was macht die E-Mail-Überschreibung für die Authentifizierung?

gpt4_bot:

Site-Einstellungskontext nachschlagen

Lese Kontext für: auth_overrides_email

Die Site-Einstellung `auth_overrides_email` in Discourse ist dafür verantwortlich, das E-Mail-Verhalten in Bezug auf externe Authentifizierungsanbieter zu steuern. Wenn diese Einstellung auf `true` gesetzt ist, bewirkt sie Folgendes:
  1. Sie überschreibt die lokale E-Mail-Adresse bei jedem Benutzerprotokoll mit der vom externen Authentifizierungsanbieter (z. B. SSO, OAuth) bereitgestellten E-Mail-Adresse.
  2. Sie verhindert, dass der Benutzer lokale Änderungen an seiner E-Mail-Adresse in den Einstellungen seines Discourse-Kontos vornimmt.

Diese Funktion gilt für alle auf der Discourse-Site konfigurierten Authentifizierungsanbieter. Diese Einstellung ist nützlich, wenn Sie die Konsistenz der E-Mail-Adressen und die Identitätsprüfung für Benutzer beibehalten möchten, die sich über externe Dienste anmelden.

Benutzer sollten jedoch bei dieser Einstellung vorsichtig sein, da es aufgrund der Normalisierung lokaler E-Mail-Adressen zu Abweichungen kommen kann. Das bedeutet, dass es zu Abweichungen oder Problemen bei der Verknüpfung von Konten kommen kann, wenn es Unterschiede gibt, wie das externe System und Discourse E-Mail-Adressen formatieren oder verarbeiten.

Der Standardwert für auth_overrides_email ist false, was bedeutet, dass Discourse standardmäßig lokale E-Mails bei jeder Anmeldung nicht mit externen Site-E-Mails überschreibt und Benutzer auch nicht daran hindert, ihre E-Mail-Adressen zu ändern.

Wenn diese Einstellung aktiviert ist, wirkt sie sich auf verschiedene Benutzerberechtigungen aus, einschließlich der Unfähigkeit, E-Mail-Adressen in bestimmten Fällen zu bearbeiten, wie sie von den Guardian- und User-Guardian-Skripten der Site verwaltet werden. Darüber hinaus beeinflusst die Einstellung, wie E-Mail-Felder angezeigt werden und ob Benutzern Anweisungen bezüglich Änderungen der E-Mail-Adresse in der Benutzeroberfläche gegeben werden.

1 „Gefällt mir“

Ich habe hier auch Probleme. Discourse bezieht seine SSO-Informationen von meiner WordPress-Website, und auth_overrides_email ist aktiviert.

Wenn ich jedoch die E-Mail-Adresse des Benutzers in WordPress aktualisiere, werden in Discourse keine Änderungen vorgenommen.

Ich habe versucht, auth_overrides_email zu deaktivieren. Dies entfernte zwar den Kommentar, dass es von einem Authentifizierungsanbieter verwaltet wurde, aber es gab nie ein Bleistiftsymbol neben der E-Mail-Adresse, weder für mich als Administrator noch bei der Nachahmung des Benutzers (was ich mehrmals tat, bevor ich die Einstellung deaktivierte, um den oben vorgeschlagenen Login/Logout zu simulieren). Alles, was ich tun konnte, war, die Adresse anzuzeigen.

Ich habe auth_overrides_email wieder aktiviert und die Adresse noch zweimal in WordPress geändert (erst in etwas anderes und dann zurück zu dem, was sie sein sollte), ohne Ergebnis.

Vorschläge?

Ich habe das gleiche Problem. Gibt es eine Möglichkeit, die E-Mail-Adresse des Benutzers in der Discourse-Datenbank zu ändern? Wie mache ich das über die Befehlszeile?

1 „Gefällt mir“

Ich muss normalerweise emails_editable aktivieren, dann auth_overrides_email deaktivieren und dann die E-Mail ändern.

1 „Gefällt mir“

Wenn Sie sie zum Abmelden zwingen, damit sie sich erneut anmelden müssen, wird die neue E-Mail-Adresse dann an Discourse übergeben?

1 „Gefällt mir“