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 Like

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 Likes

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

6 Likes

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

2 Likes

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

Thanks for your help!

3 Likes

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 Likes

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 Like

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

1 Like

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 Likes

Thanks. That makes sense.

1 Like

I have this exact same question!

@riking you mentioned that at the time of this post, in 2015, there was no way to sync a username back to Wordpress.

I like having my WP as the source of truth. But I do want to allow users to change their username here in discourse and sync back to WP as the SSO provider. (sometimes their email prefix, which is the default for the username, is not what people want as their username).

This is still not how it works. Syncing is one way from wordpress to discourse with this plugin. With sso in place, the best thing is to change username in wordpress and have the change sync to discourse. In my community this is an admin task, in part because in some cases there is a need to bulk update mentions of the old username. Users can ask admins to change their username.

5 Likes

@tobiaseigen Thank you so much for taking the time to articulate this response.

It’s helpful to know that you’re in the same boat here and to know exactly how you are handling it. I was thinking that this might be what we have to do, and I find confidence in knowing that this is how other seasoned Discoursers are managing this issue.

1 Like