We currently have a field called external_id that contains the user ID we use for SSO. I’d like to be able to pass that field via webhook. It’s currently not part of the data that’s sent over. Is there a way to add it?
AI-generated summary
In a support discussion titled “Passing SSO info via Webhook,” ebeach reports that the external_id field — used for SSO — is not being passed in User Event webhooks, despite expecting it to be included. simon initially suggests it should be present for SSO-enabled sites, but upon reviewing the code, confirms that external_id is only included in the webhook payload for admin users simon. ebeach asks if it’s possible to add the field for all users. simon notes that while adding it to the webhook payload seems safe (unlike publicly viewable data), the current restriction may be intentional, and suggests a plugin could implement it — though he wants to understand the original rationale first. Later, MSG160 joins the thread seeking the same functionality to link events back to external user IDs, asking whether the feature was ever implemented. The thread remains unresolved, with no confirmation of a fix or official update at the time of the last post.
What type of webhook are you using? For sites with SSO enabled, the external_id should be present in the User Event webhook payload.
It’s a User Event webhook but the external_id value isn’t being passed.
I just had a look at the code. It turns out that the external_id is only passed in the User Event webhook payload for admin users. I am not sure why we only send the external_id in the payload for site admins.
Would there be a way to add that field?
I know that we are cautious about adding the external_id to publicly viewable data, but it seems like it would be safe to add it to the webhook payload. Possibly someone on the Discourse engineering team will have ideas about that.
Looking at the code, it doesn’t seem like it would be difficult to add the external_id for all users to the User Event webhook through a plugin. I’d like to have a better understanding of why we’re only passing the external_id for admin users before suggesting that approach though.
I came across this topic as I was searching for a way to get external_id into the payload for web hooks. We need this information to link the event back to the user’s external_id. Did this get implemented ?