Multiple usernames for same account - email address


(chsakell) #1

Is there any way to use multiple usernames for the same email address?

Using SSO for login, the main site supports different type of accounts under the same email address. Those accounts have the same email address but different usernames. Assuming a user signs in Discourse using a specific account and creates some topics, if he/she logs out and signs in with different main site account (but same email address), the username for all the previously created topics will be updated. Is there something we can do to prevent it?


(Leo McArdle) #2

No, an email address can only be associated with one user account, and each account has only one username.

I haven’t dabbled in Discourse SSO for a little while, but if my memory serves correctly you have two options:

  1. Send a unique user id along when signing into SSO from your main site - this way if a user attempts to log in to Discourse with a different main site account, they won’t be allowed.

  2. Don’t send a username when signing into SSO from your main site. This way users can still log in to Discourse using any of their main site accounts, but they’ll have to select their own - constant - Discourse username.


(chsakell) #3

Hi Leo thanks,

I like the second sugestion but if I don’t send a username, Discourse uses the name and generates one from it combined with slashes.

sso overrides username is unchecked.

What are the settings to allow user edit the username only once, after the account created through the SSO?


(Felix Freiberger) #4

That’s not possible (without writing a custom plugin). You can, however, specify a number of days after registration when username changes are blocked for users that have posted already :slight_smile:


(chsakell) #5

I suppose username change period is the required property to set?


(Felix Freiberger) #6

Yes, that’s it. Setting it to 0 disables username changes, while any positive value allows changes for accounts that are younger than specified or have not posted yet.


(chsakell) #7

Thanks Felix, that’s very convenient.