Recently, we have moved from an old forum to discourse based forum.
The usernames on that forum were allowed to have double underscores (or multiple special characters) in the usernames.
Seems like discourse doesn’t allow those usernames. Due to this, some users are not able to login into discourse from our website using Single Sign On.
They are getting a login error.
What can be the possible solutions to this?
What exactly are the rules when creating a new username on Discourse? I am not able to find them anywhere.
Err. Yes, that’s going to be complicated (EDIT: If it’s not matching on email address, which it seems not to be?).
The code you’re looking for is https://github.com/discourse/discourse/blob/master/app/models/username_validator.rb.
But what you really want to know is that there should be a custom user field with
original_username if the username got changed. You should be able to get a list of them with something like this at the rails console:
o=UserCustomField.where("name like '%orig%'")
Normally, SSO matches on e-mail address first if I am correct.
The site setting sso overrides username is set to true.
So, what happens if a user with username not following the discourse username rules try to login via Single sign on?
I think I should enable the verbose sso logging site setting, so that I can know for sure why the user is getting the error.
That’s the question!
That’s a good first step in finding the answer!