You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6e6d782
Browse filesBrowse the repository at this point in the historyBrowse files
Use `client.webhooks.verify_event()` rather than hand-rolling the HMAC check — it implements the exact scheme WorkOS signs with, and returns the deserialized event:
secret="wh_secret_1234", # endpoint secret from the WorkOS dashboard
112
+
)
113
+
exceptValueError:
114
+
return HttpResponse(status=400) # invalid signature or stale timestamp
115
+
116
+
print(event.event, event.id)
117
+
return HttpResponse(status=200)
118
+
```
119
+
120
+
`verify_header()` does the same check without deserializing, for payloads you want to handle yourself.
121
+
122
+
The `WorkOS-Signature` header is formatted `t=<unix-timestamp-ms>, v1=<hex-sha256>` — note the `, ` separator — and `v1` is the HMAC-SHA256 of `"{timestamp}.{raw body}"` keyed with the endpoint secret. Events older (or newer) than `tolerance` seconds are rejected; it defaults to 180. Verification is local and synchronous, so it works the same on `AsyncWorkOSClient`.
123
+
94
124
## Pagination
95
125
96
126
Paginated endpoints return `SyncPage[T]` (or `AsyncPage[T]`) with built-in auto-pagination:
0 commit comments