<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
System Status
Announcements
Announcements
Search
Search
Select Language

Subscribe To Okta Status Webhook Notifications

Additional Resources

Overview

Administrators can configure an endpoint to receive an HTTP POST request whenever Okta creates, updates, or resolves an incident. The webhook URL requires specific configuration, Okta IP addresses require allowlisting, and the HMAC signature requires verification to ensure secure delivery.

 

How is a webhook subscription configured? 

  1. Open Okta Status and sign in as an Administrator of your Okta org.
  2. Open the Subscribe menu and select the Webhook tab.
  3. Enter your webhook URL and select the cells you want notifications for.
  4. Select Subscribe.

 

The webhook URL must meet specific requirements.

  • Start with https:// and be 255 characters or fewer;

  • Use port 443 and resolve to a public IP address (private and internal addresses are rejected);
  • Respond with a 2xx status within 10 seconds. Redirects are not followed.

NOTE: Each user can have one webhook URL.

Signing key

When you subscribe, a signing key is displayed. It is shown only once, so copy it and store it securely (for example, in a secrets manager). If you lose it, unsubscribe and resubscribe to generate a new one.

You will use this key to verify deliveries, as described below.

 

Which Okta IP addresses require allowlisting?

If your endpoint is behind a firewall or only accepts traffic from known sources, allow inbound HTTPS from these IP addresses. Webhook requests are sent only from:

  • 52.34.146.52
  • 52.32.155.190
  • 54.202.111.145
NOTE: IP allowlisting alone does not prove a request came from Okta. Always verify the signature as well.
 

Verify the HMAC signature

Every delivery is signed with your signing key using HMAC-SHA256, so you can confirm that the message came from Okta and was not modified in transit.

Request headers

HeaderDescription
X-Okta-Trust-SignatureThe signature, in the form v1=<hex digest>.
X-Okta-Trust-TimestampUnix time in seconds at which the request was signed.
X-Okta-Trust-Event-IdUnique ID of the event. Use it to ignore duplicate deliveries.
X-Okta-Trust-Event-TypeThe type of event.
X-Okta-Trust-Secret-VersionVersion of the signing key used for this request.

 

How the signature is computed

signed_payload = timestamp + "." + raw_request_body
signature      = "v1=" + hex( HMAC_SHA256(signing_key, signed_payload) )

timestamp is the value of the X-Okta-Trust-Timestamp header, and raw_request_body is the body exactly as received. Do not parse and re-serialize the JSON before computing the HMAC, or the result will not match.

Verification steps

  1. Read the timestamp and signature headers and the raw request body.
  2. Reject the request if the timestamp differs from your current time by more than 5 minutes (300 seconds). This protects against replayed requests.
  3. Compute the expected signature as shown above using your signing key.
  4. Compare it with the X-Okta-Trust-Signature header using a constant-time comparison. Reject the request if they differ.

 

Code examples

Node.js

const crypto = require("crypto");

function isValid(signingKey, headers, rawBody) {
  const timestamp = headers["x-okta-trust-timestamp"];
  const received = headers["x-okta-trust-signature"];

  const age = Math.abs(Date.now() / 1000 - Number(timestamp));
  if (!(age <= 300)) return false;

  const expected = "v1=" + crypto
    .createHmac("sha256", signingKey)
    .update(timestamp + "." + rawBody)
    .digest("hex");

  const a = Buffer.from(expected);
  const b = Buffer.from(received || "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

 

Python

import hmac, hashlib, time

def is_valid(signing_key: str, headers: dict, raw_body: bytes) -> bool:
    timestamp = headers["X-Okta-Trust-Timestamp"]
    received = headers.get("X-Okta-Trust-Signature", "")

    if abs(time.time() - int(timestamp)) > 300:
        return False

    signed_payload = timestamp.encode() + b"." + raw_body
    expected = "v1=" + hmac.new(
        signing_key.encode(), signed_payload, hashlib.sha256
    ).hexdigest()

    return hmac.compare_digest(expected, received)

 

Java

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

public static boolean isValid(String signingKey, String timestamp,
                              String received, byte[] rawBody) throws Exception {
    long age = Math.abs(System.currentTimeMillis() / 1000 - Long.parseLong(timestamp));
    if (age > 300) {
        return false;
    }

    Mac mac = Mac.getInstance("HmacSHA256");
    mac.init(new SecretKeySpec(signingKey.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
    mac.update((timestamp + ".").getBytes(StandardCharsets.UTF_8));
    byte[] digest = mac.doFinal(rawBody);

    StringBuilder hex = new StringBuilder("v1=");
    for (byte b : digest) {
        hex.append(String.format("%02x", b));
    }

    return MessageDigest.isEqual(
        hex.toString().getBytes(StandardCharsets.UTF_8),
        received.getBytes(StandardCharsets.UTF_8));
}

 

Go

package webhook

import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"math"
	"strconv"
	"time"
)

func IsValid(signingKey, timestamp, received string, rawBody []byte) bool {
	ts, err := strconv.ParseInt(timestamp, 10, 64)
	if err != nil || math.Abs(float64(time.Now().Unix()-ts)) > 300 {
		return false
	}

	mac := hmac.New(sha256.New, []byte(signingKey))
	mac.Write([]byte(timestamp + "."))
	mac.Write(rawBody)
	expected := "v1=" + hex.EncodeToString(mac.Sum(nil))

	return hmac.Equal([]byte(expected), []byte(received))
}

 

C#

using System;
using System.Security.Cryptography;
using System.Text;

public static bool IsValid(string signingKey, string timestamp, string received, byte[] rawBody)
{
    var age = Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - long.Parse(timestamp));
    if (age > 300)
    {
        return false;
    }

    var prefix = Encoding.UTF8.GetBytes(timestamp + ".");
    var payload = new byte[prefix.Length + rawBody.Length];
    prefix.CopyTo(payload, 0);
    rawBody.CopyTo(payload, prefix.Length);

    using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(signingKey));
    var expected = "v1=" + Convert.ToHexString(hmac.ComputeHash(payload)).ToLowerInvariant();

    return CryptographicOperations.FixedTimeEquals(
        Encoding.UTF8.GetBytes(expected),
        Encoding.UTF8.GetBytes(received ?? ""));
}

 

PHP

<?php
function isValid(string $signingKey, array $headers, string $rawBody): bool
{
    $timestamp = $headers['X-Okta-Trust-Timestamp'] ?? '';
    $received  = $headers['X-Okta-Trust-Signature'] ?? '';

    if (abs(time() - (int) $timestamp) > 300) {
        return false;
    }

    $expected = 'v1=' . hash_hmac('sha256', $timestamp . '.' . $rawBody, $signingKey);

    return hash_equals($expected, $received);
}

 

Ruby

require "openssl"

def valid?(signing_key, headers, raw_body)
  timestamp = headers["X-Okta-Trust-Timestamp"].to_s
  received  = headers["X-Okta-Trust-Signature"].to_s

  return false if (Time.now.to_i - timestamp.to_i).abs > 300

  expected = "v1=" + OpenSSL::HMAC.hexdigest("SHA256", signing_key, "#{timestamp}.#{raw_body}")

  expected.bytesize == received.bytesize && OpenSSL.fixed_length_secure_compare(expected, received)
end

 

Bash

# Compute the expected signature for a saved request body (for local testing)
SIGNING_KEY="your-signing-key"
TIMESTAMP="1700000000"        # X-Okta-Trust-Timestamp header
BODY_FILE="body.json"         # raw request body, exactly as received

printf '%s.' "$TIMESTAMP" | cat - "$BODY_FILE" \
  | openssl dgst -sha256 -hmac "$SIGNING_KEY" -hex \
  | sed 's/^.* /v1=/'

# Compare the output with the X-Okta-Trust-Signature header.

 

What are common troubleshooting steps for webhook deliveries?

  • Signatures never match: check that you are hashing the raw body (not re-serialized JSON) and the exact signing key you were given.
  • Timestamp rejected: make sure your server clock is synchronized (NTP).
  • Not receiving requests: confirm the three IP addresses above are allowed and that your endpoint returns 2xx within 10 seconds. If deliveries fail, we may notify you by email.
Loading
Subscribe To Okta Status Webhook Notifications | Okta Support