Skip to main content

How it works

  1. 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.
  2. Nango reads the org from the payload’s source field, for example https://acme.okta.com/api/v1/eventHooks/<HOOK-ID>, and matches it against each connection’s Okta hostname or subdomain. It then checks the X-Nango-Webhook-Secret header against that connection’s own webhook secret.
  3. Nango routes each event in data.events to that connection, using its eventType as the webhook type.
Okta doesn’t sign event hooks, so every connection sets its own secret, sent by Okta as the hook’s authentication header. Each connection needs its own event hook in its Okta org and its own 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 with openssl 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 as webhookSecret in the connection’s metadata. Do this before creating the hook, so the first events aren’t rejected:
See Update connection metadata for the full reference.
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

  1. In the Okta Admin Console, go to Workflow → Event Hooks and select Create Event Hook.
  2. Set the Endpoint URL to the URL from step 1.
  3. Set Authentication field to X-Nango-Webhook-Secret and Authentication secret to the secret from step 2.
  4. Pick the events to subscribe to, and save.
  5. Select Verify. Okta sends a one-time GET challenge, and Nango answers it without routing anything.
Okta retries a failed delivery only once. If the secrets don’t match, or the connection has no webhookSecret, events are rejected and lost. Allow unverified webhooks doesn’t apply to Okta: every connection needs its own webhookSecret.

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 webhookSubscriptions and onWebhook. Subscribe to event types like user.lifecycle.deactivate or group.user_membership.add. See Real-time syncs.
Okta delivers at least once and may deliver out of order. Deduplicate on each event’s 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:
Then clear webhookSecret from the connection’s metadata.
Need help getting started? Join us in the community.