Letting users choose whether to show Full Name

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.

1 Like

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.

5 Likes

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.

1 Like

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: .

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.

@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.

As long as this option isn’t set:

image

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.

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.

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

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.

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.

1 Like

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!

3 Likes

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?

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.

2 Likes

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.

1 Like

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?

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)

6 Likes

You are quite right sir! Thank you!

4 Likes

This question is from 2018 and maybe things have changed.

  • I have “full name required” checked.
  • I disabled “enable names: Show the user’s full name on their profile, user card, and emails. Disable to hide full name everywhere
  • I let “display name on posts” checked - but they are not showing anyway due to the above option disabled that takes precedence I guess.

From this point, can a user have her/his full name displayed with her/his username when posting if (s)he decides so? Or is that a system-wide setting only?