How it works
- Okta sends a POST request to your Nango webhook URL when a subscribed System Log event occurs, for example
user.lifecycle.deactivate. These are event hooks. - Nango reads the org from the payload’s
sourcefield, for examplehttps://acme.okta.com/api/v1/eventHooks/<HOOK-ID>, and matches it against each connection’s Oktahostnameorsubdomain. It then checks theX-Nango-Webhook-Secretheader against that connection’s own webhook secret. - Nango routes each event in
data.eventsto that connection, using itseventTypeas the webhook type.
webhookSecret in Nango. Deliveries with a missing or wrong secret are rejected.
This applies to the Okta, Okta (Preview), Okta (API Token) and Okta (Client Credentials) integrations.
Setup
1. Get your Nango webhook URL
In the Nango dashboard, open your Okta integration and copy the Webhook URL.2. Pick a webhook secret
Generate a random secret of at least 16 characters for the connection, for example withopenssl rand -hex 32. You use the same value in Nango and in Okta.
Use a different secret for each connection. Admins of an Okta org can see its hook configuration, so a shared secret would let one org send events as another.
3. Set the webhook secret in Nango
Store the secret aswebhookSecret in the connection’s metadata. Do this before creating the hook, so the first events aren’t rejected:
The webhook secret on the integration’s Settings page is not used for Okta. Nango only verifies against the connection’s
webhookSecret.4. Register the event hook in Okta
- Okta Admin Console
- Okta API
- In the Okta Admin Console, go to Workflow → Event Hooks and select Create Event Hook.
- Set the Endpoint URL to the URL from step 1.
- Set Authentication field to
X-Nango-Webhook-Secretand Authentication secret to the secret from step 2. - Pick the events to subscribe to, and save.
- Select Verify. Okta sends a one-time GET challenge, and Nango answers it without routing anything.
Handle the webhook
Once routed, you have two options:- Forward it to your app: Nango forwards the whole delivery to your webhook URL with connection attribution. See External webhook forwarding.
- Process it in a sync: run a sync when the webhook arrives using
webhookSubscriptionsandonWebhook. Subscribe to event types likeuser.lifecycle.deactivateorgroup.user_membership.add. See Real-time syncs.
uuid and order by published. See Event types for the events you can subscribe to.
Rollback strategy
Deactivate and delete the hook in Workflow → Event Hooks, or with the API:webhookSecret from the connection’s metadata.