Lock username to GitHub username when authenticating using GitHub

(Quincy Larson) #1

User story: As a new user, when I authenticate with GitHub, my username is automatically set to whatever my GitHub username is, and I cannot change it unless I change my username on GitHub.

The reason this would be helpful is that our open source community, Free Code Camp, uses GitHub authentication for our website, Gitter chat, and our Discourse. We want to maintain a consistent identity across all three of these services (plus GitHub itself) for convenience and consistency.

This could be rolled into the same package as Import GitHub image as profile image when authenticating with GitHub

CC @michaelhenderson

(Sam Saffron) #2

We have a similar option with SSO, but I am not 100% sure this belongs in core, maybe as a site setting default off.

(Quincy Larson) #3

@sam yes - are you talking about this?

Even though this has been set to “0” I am still able to change my username.

Also, the SSO override option doesn’t seem to work as I understand it. I changed my username, signed out, then signed back in with GitHub and it did not revert my local username to my SSO username.

I’m not sure whether these are known issues or I’m just doing it wrong :slight_smile:

(cpradio) #4

If you were still logged in as an Admin, that could be why. Admins are excluded by most settings that disable things. You might want to try that setting and login as a normal user.

(Quincy Larson) #5

@cpradio I just confirmed that non-admin users can also change their usernames. This user (who is a mod and not currently an admin) was able to change his username last night even though the “username change period” was set to 0. So this functionality does not seem to be working currently.

(cpradio) #6

That also isn’t a good test. Staff seem to be immune, here is the logic:

So you need a regular member.