Skip to content

Commit 794d519

Browse files
committed
Adding more flavor around cross tenant concerns
Came out of this comment: FusionAuth/fusionauth-issues#1543 (comment)
1 parent 33515f1 commit 794d519

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

site/docs/v1/tech/events-webhooks/writing-a-webhook.adoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,25 @@ Your Webhook must handle the RESTful request described above and send back an ap
1616

1717
=== Configuration
1818

19-
Once your Webhook is complete and listening for events, you must configure your Webhook URL in FusionAuth. To add a webhook navigate to [breadcrumb]#Settings -> Webhooks#. If you have multiple Webhooks configured for a single Application, the transaction setting for the event or the User Action will dictate if FusionAuth will commit the transaction or not.
19+
Once your Webhook is complete and listening for events, you must configure your Webhook URL in FusionAuth. To add a webhook navigate to [breadcrumb]#Settings -> Webhooks#.
20+
21+
Then, configure the Tenant to listen for the event by navigating to [breadcrumb]#Tenants -> Your Tenant -> Webhooks#.
22+
23+
If you have multiple Webhooks configured for a single Tenant, the transaction setting for the event will dictate if FusionAuth will commit the transaction or not.
24+
25+
If you have multiple tenants listening for the same event, they will all recieve that event and can filter on the provided [field]#tenantId# to determine if they should handle the event.
26+
27+
=== Example Configuration
28+
29+
Here's an example scenario. You have two tenants, Pied Piper and Hooli. You have configured two webhooks listening for `user.create` events. One updates a separate user database, the other records information in an analytics system. Both the Pied Piper and Hooli tenants have the `user.create` event enabled in their webhook configurations.
30+
31+
In this scenario, each webhook will receive data when a user is created in either tenant, Pied Piper or Hooli.
32+
33+
Transaction settings can be managed at the tenant level, but the webhooks receiveing an event are not. Any webhook that is configured to receive the `user.create` event will play a role in the transaction. It is not possible, for example, to, require only the analytics webhook to succeed for the Pied Piper tenant and only the user database sync to succeed for the Hooli tenant. If you need this level of granularity, run different FusionAuth instances.
34+
35+
If you are separating your staging and production environments using tenants, webhooks will cross those boundaries. While you can filter on the tenant in the webhook itself, if you register both a production webhook and a staging webhook for the same event, the production webhook will receive staging data and the staging webhook will receive production data. In addition, webhook transactions will depend on both. The workaround is to run separate FusionAuth instances.
36+
37+
Please review this issue for additional information about https://github.com/FusionAuth/fusionauth-issues/issues/1543[future webhook improvements].
2038

2139
=== Calling FusionAuth APIs In Webhooks
2240

0 commit comments

Comments
 (0)