SSO with Wordpress but users cannot change their username

I have the SSO for Wordpress installed configured and working,… users are able to signup/login as expected.

However users cannot change their username.

I’ve set the username change period to 90 days but that still doesn’t allow users to change their name (within 90 days of creating the account, users still cannot change their username)

Here’s the user’s screenshot showing the lack of an edit pencil next to their username.

1 个赞

Fairly certain this is because you are using SSO and since you tied it to your wordpress database, that is where the change would have to take place.

2 个赞

What @cpradio said and also I’m guessing you might have the sso overrides username setting enabled.

6 个赞

Yep, if you turn that off people should be able to change their username again.

2 个赞

Thanks all! I unchecked the sso overrides username and viola it worked!

Thanks for your help!

3 个赞

Would this break the sso with workdpress if people are chaging their
username on Discourse? WP does not allow the changing of usernames.

There are some WP plugins that let you change usernames. I use this one:

If you have sso overrides username enabled then the next time the users logs in their username will update in Discourse. If you have it disabled, then I think if you just change their username in Discourse to match all should be fine.

5 个赞

Great. Thanks.

When changing the username do i change in discourse as well or will SSO update it for me? I am assuming i need to update Discourse as well through admin so it does not create a new account correct?

Is there a way to allow a user to change usernames in Discourse and sync it back to WP?

1 个赞

Not right now, no. The whole design of SSO is around the remote being the source of truth about identity.

1 个赞

Changing the username will not break SSO.

SSO is never tied to the username, but to the external id and E-Mail address. If the external ID is not known to Discourse, it associates it with the account having the same E-Mail address (or creates a new one). Afterwards, any changes to the account won’t affect this invisible link, Discourse will always recognize the account by its ID.

3 个赞

Thanks. That makes sense.

1 个赞

我也有完全相同的问题!

@riking 你提到在 2015 年发布此帖子时,无法将用户名同步回 WordPress。

我倾向于将 WordPress 作为唯一真实来源。但我确实希望允许用户在此 Discourse 中更改用户名,并将其同步回作为 SSO 提供程序的 WordPress。(有时他们的邮箱前缀,即用户名的默认值,并不是用户想要的用户名)。

这仍然不是它的运作方式。使用该插件,同步是单向的,从 WordPress 到 Discourse。在启用 SSO 的情况下,最佳做法是在 WordPress 中更改用户名,然后让更改同步到 Discourse。在我的社区中,这是一项管理员任务,部分原因是某些情况下需要批量更新对旧用户名的提及。用户可以请求管理员更改他们的用户名。

5 个赞

@tobiaseigen 非常感谢您花时间如此清晰地阐述这一回复。

得知您也面临同样的情况,并了解您具体如何处理,对我们很有帮助。我原本就在想这可能就是我们需要采取的做法,而得知其他经验丰富的 Discourse 用户也是以这种方式处理这一问题,让我倍感安心。

1 个赞