Agent skill
Auth0 Webhooks Skill
Receive and verify Auth0 webhooks delivered by Event Streams. Use when setting up an Auth0 event stream with a webhook destination, checking the bearer Authorization header, or handling CloudEvents-shaped events like user.created, user.updated, user.deleted and organization.member.added.
Install this skill
npx skills add hookdeck/webhook-skills --skill auth0-webhooks
Auth0 Event Streams send real-time events about your tenant (users, organizations, groups, roles and connections) to a webhook endpoint you control. Each request is an HTTP POST carrying one CloudEvents-shaped JSON object: type says what happened and data.object holds the entity.
Auth0's separate Custom Log Streams export tenant logs (logins, failed logins and other data.type codes) in batches. They are a different product; see references/log-streams.md.
When to Use This Skill
- How do I receive Auth0 Event Streams events on a webhook?
- How do I secure an Auth0 event stream webhook endpoint?
- How do I check the Authorization header Auth0 sends?
- How do I handle
user.created,user.updatedanduser.deleted? - Why did my Auth0 event stream stop delivering?
Verification (core)
Auth0 Event Streams don't sign requests. Each stream's webhook destination has an authorization method (bearer, basic or custom_header). With bearer, Auth0 sends Authorization: Bearer <token> on every request, where <token> is the value you set on the stream. Compare the whole header with a timing-safe check, and serve the endpoint over HTTPS (Auth0 requires an https:// endpoint).
const crypto = require('crypto');
// Compare the incoming Authorization header with "Bearer <your token>".
function verifyAuth0Authorization(headerValue, token) {
if (!headerValue || !token) return false;
const a = Buffer.from(headerValue);
const b = Buffer.from(`Bearer ${token}`);
if (a.length !== b.length) return false; // timingSafeEqual requires equal length
return crypto.timingSafeEqual(a, b);
}
Then return a 2xx quickly. Auth0 makes four attempts in total (retries after 1s, 2s and 4s), and a 4xx response fails the event with no retry.
For complete handlers with route wiring, event dispatch, and tests, see:
Common Event Types
| Event | Fires when |
|---|---|
user.created | A user account is created |
user.updated | A user's profile or metadata changes |
user.deleted | A user account is deleted |
organization.member.added | A user is added to an organization |
organization.member.deleted | A user is removed from an organization |
group.created | A group is created |
role.created | A role is created |
For the full list, see the Auth0 Event Catalog.
Environment Variables
# The token you set as the event stream's bearer authorization.
AUTH0_EVENT_STREAM_TOKEN=your-long-random-secret
Local Development
# Start tunnel (no account needed)
npx hookdeck-cli listen 3000 auth0 --path /webhooks/auth0
Use the printed URL as the event stream's webhook endpoint.
Reference Materials
- references/overview.md - Event Streams, the event envelope and delivery behaviour
- references/setup.md - Create an event stream with a webhook destination
- references/verification.md - Authorization header checks and gotchas
- references/log-streams.md - Custom Log Streams, Auth0's separate log export