Usernames are deleted on login

Every time someone clears their cache and re-logins into Discourse, it wipes out their username and resets it to the word “user” and then a number. If I fix the username manually, on the next log back in, the username is reset to “user1” again.

I have a self-hosted installation of Discourse, running the latest version - 3.5.0.beta3-dev, but the issue started happening after the last time I updated on March 21. We use SAML and the discourse-saml plugin to authenticate with our organizational identity provider. Users don’t choose their usernames - we’ve been using SAML to set them automatically in a “first.last” format. I have not recently changed any plugins or site settings, although I did do a “./launcher cleanup” around the same time as the issue occurred. Perhaps there was a recent change to discourse-saml that might be causing this?

As a temporary stopgap, I’ve disabled the setting “Prioritize username in UX” to display names instead of usernames.

Don’t clear your cache?

What usernames do you see at /admin/users

1 Like

I have a feeling that somehow you have you SAML implementation overriding usernames, so when they re-auth, we take the name provided by SAML.
I would check saml_clear_username or auth overrides username settings.

2 Likes

Thank you for your response. Both saml_clear_username and auth_overrides_username are disabled.

This is an example of what I see on admins/users