Letting users choose whether to show Full Name

(Denis Heraud) #1

We use SSO on our Discourse forum, and we would like to grab the forum users’ Full Names from our database, however we would also like to respect our users’ right to privacy, and as there is no option to hide these if they so choose, it seems there is no way for us to have our cake and eat it too.

It would be nice to have a feature where users can choose to show their full name on their profile. So it could still be passed over in SSO, but the user can choose whether to display it or not.

(Jay Pfaffman) #2

I’m regularly annoyed when a site that knows my name requires me to enter it, but It’s not that much more trouble to enter your name than to click a check box.

I think your solutions are have your SSO know whether to provide the data in the first place or get a custom plugin.

(Denis Heraud) #3

I think you would be surprised! I think users are more likely to seek out the checkbox if they don’t want to have their names displayed than they are to seek out the box in which to enter their name (as there is little personal incentive to do it). I’d rather have people’s names up as we are a pretty tightly knit community and it’s hard to know who you are talking to at times. However, I would rather they have the option to hide their name if they so chose.

(Denis Heraud) #4

May I use this space to reiterate my desire for the ability to hide privacy conscious users’ Full Name on their own user profile preferences if they so choose? :slight_smile: .

Show full name in front of @username?
(Michael Brown) #5

Full Name is optional by default - the user can choose to set it or not as they prefer.

In your case if you clear sso overrides full name it should accomplish what you’re trying to do.

(Denis Heraud) #6

@supermathie Sorry I meant when using SSO. In our case we pass their Full Name in SSO by default. But we’de like to offer a way for users to “not” display their Full Name if they so choose. As it stands there is no way to do that when passing Full Names through SSO.

(Michael Brown) #7

As long as this option isn’t set:


then the user can change their full name as they see fit after initial sign-in and it won’t get overridden by subsequent SSO logins.

(Denis Heraud) #8

Thanks for your reply @supermathie. Although I’m confused as to how that’s a potential solution. If we uncheck it, then any “new” users would not have their Names passed on, and if we leave it checked, users get their Names passed on but can’t change/delete it. In a situation like ours where SSO is always on, then there is no way for users to delete/hide their names.

Show full name in front of @username?
(Michael Brown) #9

Not sure why you quoted “new”, but new users get that value initially set from SSO.

(Denis Heraud) #10

Sorry I quoted “new” because they may not be new in our own user database, but they may be new to our Discourse forum when they log into it for the first time. So if we don’t check that SSO box, then these users that log in for the first time won’t get their names passed along in SSO.

(Michael Brown) #11

I had checked exactly that behaviour on my test SSO setup before suggesting that and the full name does get set in initial user creation even without that setting.

(Denis Heraud) #12

Oh! Sorry! Though you can understand my confusion, that the name gets passed regardless of the setting being enabled or not. :wink: I’ll test that on my end!

(Denis Heraud) #13

I’m curious, how would we go about fetching the names for all of our other users that already have logged in in the past? Would they each have to log in again with the setting checked to pass their names along? And since that seems unlikely to happen, is there any other way to go about it? How would we fetch Names for all existing users without leaving the SSO option turned on?

(Michael Brown) #14

You’re looking for the user list?

You can use the sync_sso API as described here: Sync SSO user data with the sync_sso route

I’m not sure about whether updating a record using sync_sso obeys sso_overrides_name - you’ll need to test that.

You can always use the Admin API - I would first define your workflow and then search through the API to find the API endpoints you need to call to accomplish your goals - they’re all there.

(Denis Heraud) #15

Ooooh nice! I didn’t know you could do that! Many thanks! That basically solves it for me I think, I’ll have to test it out to confirm. Will update.

(Denis Heraud) #16

Hey @supermathie, so I finally tested today. I created a new user and logged in with “sso overrides full name” disabled, and you’re right, the Full Name gets passed on the first time a user logs in.

However, your solution doesn’t work because although users can delete their name from that field in their preferences, you can’t save it because the field cannot be left blank… So back to square one, how does a user delete/hide their name if they don’t want it to show up after it gets passed by SSO on initial login?

(Michael Brown) #17

I suspect you have the full_name_required setting enabled on your site - disabling that will allow the users to blank it out.

(even if you didn’t they could change it to be whatever they want such as the same as their username)

(Denis Heraud) #18

You are quite right sir! Thank you!