User fields not saved when creating user (sso)


#1

Hi guys,

We are trying to push custom fields to Discourse from our SSO platform. Our objective is to use a webhook catching the new_user event and perform some tasks using our custom fields.

In my SSO platform I set the custom field “custom.cityId=35249”. I checked my logs and I’m able to confirm that this parameter is successfully sent to Discourse.

However, when i check the webhook logs (user_created event) I see that custom_fields is set to null!

“custom_fields”: null

If i ask the user to manually edit their profile (change the name for example) and save it, then the webhook is triggered and I can see this custom field in the logs…

“custom_fields”: {
“cityid”: “35249”
},

We are running the latest version of Discourse (Version v1.9.0.beta13 +155 1.9.0.beta13)

Any idea?

Thx
Seb


#2

I did some testings with three different users.

1/ Users don’t exist in Discourse (if they do, I delete them from the admin dashboard)

2/ I ask the users to login using our SSO login page

3/ SSO page redirects the users to https:///session/sso_login?

4/ Then our Webbook is triggered and send the user_created event

Results:

  • 2/3 tests: discourse sends custom_fields = null to our webhook
  • 1/3 test : discourse sends the correct value to our webhook

When I decrypt the base64 encoded payload, I can see that cityid is correctly sent to discourse.

When users edit their profile, the custom field is correctly send to the webhook (100% of the time)

I do not see errors in the logs

I have updated Discourse to the latest possible version!

Any help would be appreciated here :slight_smile:

Thx
Seb