Username mismatch with Discourse's SSO Username

(Aysha) #1

SSO is correctly configured for my site as I haven’t experience this problem before. However, one of my users reported that her username was automatically changed; Discourse automatically appended a 1 right after her username. When I check her profile, I noticed that her Single Sign On username is different from the local username. Her Single Sign On external_id information is showing correctly; I know that it is important for the external_id to be stable. I believed that I have send the correct external_id as we used the user’s user_id so that it will be unique to each users. Her external_id is correct after double checking.

Any idea why this may happen? It may be a Discourse bug but could be caused by user behavior as well? Is there any kind of user behavior that can cause this? And how can I revert her username back to her SSO username?

This is a screenshot of the SSO information: sso —
This is a screenshot of the local username: local_user_id —

When I search for her username, ‘mariliam’ doesn’t exists. Only ‘mariliam1’. ‘mariliam’ is listed only as her SSO username information on her profile.

PS: I just updated to Discourse v1.3.0beta4 yesterday and prior to this update, I didn’t have any problem. I am not sure if the update would have cause this.

(Jesse Perry) #2

What’s your “SSO overrides username” setting in Admin?

(Aysha) #3

I have all SSO overrides settings checked. That includes SSO overrides username.

(Jesse Perry) #4

Did she log out & log back in? That’s when the payload updates and would do the override.

(Aysha) #5

Alright, I am going to tell her to do that and update you. As far as I know, she didn’t log out and log in again.

(Kane York) #6

Keep in mind that if the username / name / avatar never change on the provider side, the override settings don’t need to be set

(Aysha) #7

But having it set shouldn’t affect anything right?

(Kane York) #8

Yes, actually, it can mess things up, I remain unconvinced that the code is free of bugs. So it could affect (probably is currently) this.

(Aysha) #9

Logging in and logging out doesnt seem to be solving the issue. Her local username still stays the same. Any other ideas on how I can revert back her username?

(Jesse Perry) #10

No idea. A complete guess is to check what you have set as your “username change period” admin setting. Perhaps if the user is beyond that period (that number defines how long the user has until they can’t change it again), that setting is overriding the SSO overwrite and disallowing it. Again, just a guess.

Of course you could just manually change it for the user in your admin settings for the user, right?

(Aysha) #11

Yes I can change it but I am afraid it would affect her mentions. Oh well. Thank you so much for your replies.

(Jesse Perry) #12

Well it would affect her mentions regardless (whether SSO overwrote the username or you did manually), so that’s up to you.

(Kane York) #13

Put it this way… the mentions & quotes are already screwed up!

(Aysha) #14

Yeah, you’re right. I tried changing the username. However, I got a very helpful error that only says “There was an error changing your username”. Changing the username can’t seem to work either.

(Sam Saffron) #15

disable sso, change username, enable sso.

(Kushal) #16

After the new update, the email id is being registered as the username for discourse instead of the the username passed from drupal site. How can i fix this ?

(Kushal) #17

is anybody facing the same problem ? How do i go about fixing this ? Im sure its not very hard to do it, just need some pointers.