Sending Title by SSO, but there is no SSO Overrides Title setting?

I’ve just added a Title datablock to my SSO payload and it properly sets the title, but doesn’t seem to update it again in subsequent logins.

I figured I should make sure the settings are set to allow SSO to override the title. But I don’t find an SSO Overrides Title setting? Was it missed in the addition of Title to the SSO payload? Or implied within some other setting?

My community really needs this as I’m setting the title based on the aircraft they own, and that changes from time to time!

From looking at the Discourse code, it seems that if title is included in the SSO payload, the user’s title will be set every time they login to Discourse with SSO. One thing to note is that you can’t create a title by adding it to the SSO payload, you need to supply the title of an existing Discourse group that the user is a member of.

I have tested this on my own site, and it’s working correctly for me.

That is interesting, because I am definitely creating titles by adding them to the payload, and they are not groups. For example:

image

As you can see, for this group of aircraft owners that title is very useful, so this is good functionality!

Based on my testing, once the title is set the SSO payload will not change or reset that title. And the users also can’t edit the title… although I do see the connection to groups there, because what they can do is select a group they would like to show as their title.

Perhaps this is turning into a feature suggestion? Or an ‘extend this feature’ thought? It is really a nice thing for our purpose.

You are right. What threw me off was seeing the title set to ‘None’ when I send a title that doesn’t correspond to the title of a group that the user is a member of:

But sending any title in the payload does update the user’s title on each SSO login. You can check this from the rails console or with the Data Explorer plugin if that is installed on your site.

That seems to be the downside of this approach. The only titles that can be selected by a user on their profile page are the titles of Discourse groups that the users belong to.

That actually works quite well for us, as our membership management system keeps track of these details, and sometimes our members need a reminder to update their profiles. :slight_smile:

I just tested it again and now it’s working. That’s always a love/hate thing… glad to not have to fix it, but confused why my testing showed an issue before. So we’re good, thanks!

1 Like

I figured out the reason my testing didn’t work. You can change a title, but you can’t set it to null through SSO. If you send a title of null it won’t clear the title.

I added some SSO code to turn any null title into a “-” and that worked. I didn’t try a space, that might work too.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.