Skip to content

Update webhooks events #775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a tenant or application scoped event. It can be sent to all applications in a tenant or to one or more specified applications.

The ability to limit the generation of an event for only certain applications is legacy functionality and may be modified in the future. You almost certainly want to enable this event at the tenant level and optionally filter on the `applicationId` when consuming the event.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a tenant scoped event.
93 changes: 81 additions & 12 deletions site/docs/v1/tech/events-webhooks/events.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@ These are the events that FusionAuth generates that can be optionally consumed b
* <<JWT Refresh>> - when an access token is refreshed using a refresh token
* <<JWT Refresh Token Revoke>> - when a refresh token (or multiple tokens) are revoked

=== Tenant Scoped Events

Tenant scoped events are generated for all applications in a tenant or for none of them.

All user events are tenant scoped because a user is a tenant scoped entity. For example, the `user.delete`, `user.create`, `user.update`, and `user.deactivate` events are all tenant scoped.

A tenant scoped event can, however contain an `applicationId` which can be used to filter events when received. One example is `user.registration.create`.

=== Application Scoped Events

A few events can be generated for one or more specified applications, or for all applications within a tenant.

[WARNING]
====
The ability to limit the generation of an event for only certain applications is legacy functionality and may be modified in the future. You almost certainly want to use a tenant scoped event and optionally filter on the `applicationId` when consuming the event.
The ability to limit the generation of an event for only certain applications is legacy functionality and may be modified in the future. You almost certainly want to enable events at the tenant level and optionally filter on the `applicationId` when consuming the event.
====

These events can be application scoped:
Expand All @@ -42,16 +50,6 @@ These events can be application scoped:
* `jwt.refresh-token.revoke`
* `user.action`

=== Tenant Scoped Events

Any events which are not application scoped events are tenant scoped.

Tenant scoped events can't be limited to fire only for a certain application. These events are either generated for all applications in a tenant or for none of them.

All user events are tenant scoped because a user is a tenant scoped entity. For example, the `user.delete`, `user.create`, `user.update`, and `user.deactivate` events are all tenant scoped.

A tenant scoped event can, however contain an `applicationId` which can be used to filter events when received. One example is `user.registration.create`.

== User Actions

This event is generated when a User Action is taken on a user and when temporal actions transition between phases.
Expand All @@ -64,10 +62,14 @@ A temporal action is one that has a start time and and a duration, when a phase
user.action
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-or-application-scoped-event.adoc[]

=== Event Body

[.api]
[field]#event.action# [type]#[String]#::
[field]#event.action# [type]#[String]::
This parameter specifies the name of the action that is occurring.

[field]#event.actionId# [type]#[UUID]#::
Expand Down Expand Up @@ -159,6 +161,10 @@ The final state of the operation which caused the webhook is not persisted to Fu
user.bulk.create
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -198,6 +204,10 @@ The final state of the operation which caused the webhook is not persisted to Fu
user.create
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -235,6 +245,10 @@ This event is generated when a user is updated. The event will include the befor
user.update
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -276,6 +290,9 @@ This event is generated when a user is deactivated, also referred to as a soft d
user.deactivate
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

Expand Down Expand Up @@ -315,6 +332,10 @@ This event is generated when user is re-activated, a re-activated user is one th
user.reactivate
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -353,6 +374,10 @@ This event is generated when a user is deleted.
user.delete
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -395,6 +420,10 @@ This event is generated when a user verifies their email address.
user.email.verified
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -437,6 +466,10 @@ This event is generated when a user completes a successful login.
user.login.success
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -496,6 +529,10 @@ This event is generated when a user login request fails due to invalid credentia
user.login.failed
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -547,6 +584,10 @@ This event is generated when Reactor detects a user is using a vulnerable, or br
user.password.breach
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -591,6 +632,10 @@ The final state of the operation which caused the webhook is not persisted to Fu
user.registration.create
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -639,6 +684,10 @@ This event is generated when a user registration has been updated.
user.registration.update
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -691,6 +740,10 @@ This event is generated when a user registration has been deleted.
user.registration.delete
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -739,6 +792,10 @@ This event is generated when a user registration has been verified.
user.registration.verified
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -783,6 +840,10 @@ This event is generated when a public key configuration used to sign a JSON web
jwt.public-key.update
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-or-application-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -825,6 +886,10 @@ This event is generated when an access token is refreshed using a refresh token.
jwt.refresh
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-scoped-event.adoc[]

=== Event Body

[.api]
Expand Down Expand Up @@ -877,6 +942,10 @@ The following scenarios will cause this event to be generated:
jwt.refresh-token.revoke
----

=== Event Scope

include::docs/v1/tech/events-webhooks/_tenant-or-application-scoped-event.adoc[]

=== A single Refresh Token is revoked

This example JSON would reflect a scenario where a single refresh token is revoked for a single user for a single application.
Expand Down