SSO and Custom User Fields


(Failcookie) #1

I have setup SSO with my PHP app and it is working perfectly so far! I am looking to up the coolness a little bit by sending over some profile data from my webapp over to the profile data on my Discourse app. Is this something that be done at the moment? Or will I need to setup some soft of plugin as a work around?

Follow-up - Since these fields are automated from SSO, I have kept them from being editable by users. Where do these fields show up at for the users? On their profile or card?


(Erick Guan) #2

Use custom. param:

For example, ?custom.x= which x is the custom field.

I think you can then use it as you like in the plugin? I believe it’s not shown on the profire or card either.


(Failcookie) #3

Perfect. Thank you for this!

I was just curious if there was anyway to showcase the custom fields, or if they were just bonus information for the backend.


(Michael Downey) #4

AFAIK the only place this is seen now is for the user only at: https://discourse.example.org/users/USERID/preferences

Best case would be something to show the user a message like “edit these fields at X” where X is your SSO provider. And give them the option to show it on the public profile page.


(Failcookie) #5

Use custom. param:

For example, ?custom.x= which x is the custom field.

In response to this, if I have a field that is “Times Edited” and I want to push it from PHP - would it need to be “?custom.times_edited”? Or is there another way Discourse crams the words in user fields together?


(Failcookie) #6

Just wanted to follow up on this issue I am having. I can successfully send over all day at inputs that are default from SSO to Discourse. I still can’t send over custom field properly. Are the custom fields names something different then what I put in the field on creation?


(Erick Guan) #7

Sorry for late response. I think the name of user field is user_field_1 according to the order they are created. 1 means the first user field you created.


(Failcookie) #8

This worked perfectly! Thank you so much for the help!