Allow Manual Username Selection During Google SSO Registration
-
Hey everyone!
I've been setting up a NodeBB forum and I'm using the Google SSO plugin for login. I've run into a bit of an issue and wondering if anyone knows a fix?
So here's what's happening - when people log in with their Google accounts, the plugin automatically assigns them a username based on their Google account. The thing is, I've turned off the ability to change usernames after registration (for forum consistency reasons), but now I realize this means people are stuck with their Google-based usernames forever!
I'd really like for users to be able to pick their own usernames during the initial registration process, especially since some might want to stay anonymous rather than having their Google identity exposed.
Does anyone know if there's already a setting for this that I'm missing? Or maybe a workaround? I've looked through the plugin settings but couldn't find anything obvious.
If this feature doesn't exist yet, would love to hear if there's a way to implement it or if someone has already created a modified version of the plugin.
Thanks in advance for any pointers! -
Hey everyone!
I've been setting up a NodeBB forum and I'm using the Google SSO plugin for login. I've run into a bit of an issue and wondering if anyone knows a fix?
So here's what's happening - when people log in with their Google accounts, the plugin automatically assigns them a username based on their Google account. The thing is, I've turned off the ability to change usernames after registration (for forum consistency reasons), but now I realize this means people are stuck with their Google-based usernames forever!
I'd really like for users to be able to pick their own usernames during the initial registration process, especially since some might want to stay anonymous rather than having their Google identity exposed.
Does anyone know if there's already a setting for this that I'm missing? Or maybe a workaround? I've looked through the plugin settings but couldn't find anything obvious.
If this feature doesn't exist yet, would love to hear if there's a way to implement it or if someone has already created a modified version of the plugin.
Thanks in advance for any pointers!@shraga100 hmm your options are fairly limited out of the box, unfortunately.
The Google SSO plugin is pre-populating the usernames upon registration mostly as a convenience measure, so the name is recognizable (and most times, what they want to show).
Of course that's not always going to be the case, and especially in situations where you have username changes turned off, that could be problematic.
A possible solution here would be to write an additional feature to the Google SSO plugin (or perhaps a separate plugin) that would introduce an registration interstitial to prompt for a username change, but it seems pretty niche, to be honest.
-
-
We register users outside of NodeBB, but the strategy we employ for social logins should be easily adaptable to the Google SSO plugin.
Basically use a random name generator, we use
unique-names-generator
but there are others.Usage is fairly simple, you define some dictionaries of acceptable words and let the library combine them to create a unique name.
const { uniqueNamesGenerator, NumberDictionary, adjectives, colors, bilbo, animals, names, starWars } = require('unique-names-generator')
You can test for the existance of the generated name and, if needed, iterate to get a unique name. The length of the combinations can be increased to further enhance uniqueness.
let newName = uniqueNamesGenerator({ dictionaries: [colors, bilbo, starWars, animals, colors, names, starWars], length: 2, separator: '', style: 'capital' })
-
Note that our reason for implementing this has to do with maintaining privacy since its often relatively easy to reconstruct a social id/email from the username. We do allow users to 'alias' their names after registration, but users don't always realize the need to protect their identity.