Verify Workspace ONE (Omnissa) webhooks

Workspace ONE UEM doesn't sign event notifications, so there's no signature to check and no SDK to verify one. Omnissa says they use basic user authentication, so your endpoint compares the rule's user name and password from the Authorization header in constant time. That authenticates the sender, but it doesn't protect the body or stop a replay.

The facts

Signature header
None (unsigned)
What to build
Compare the Basic username and password with your stored values

Workspace ONE (Omnissa) webhook secret

Entered on the rule. The page calls them the Workspace ONE UEM user name and password, and says they set which user account authorizes the notification. It does not say whether the console checks them against a real account. Keep it in an environment variable, not in source code.

  • Set on each rule as **User Name** and **Password / Confirm Password**, under Groups & Settings > All Settings > System > Advanced > API > Event Notifications
  • Omnissa describes them as a Workspace ONE UEM user name and password, and doesn't say whether the console checks them against a real account
  • Each rule has its own pair. No secret is generated for you, and no rotation process is documented

Source: Workspace ONE (Omnissa) docs ↗

Code

express/src/index.js
javascript
// Generated with: workspace-one-webhooks skill
// https://github.com/hookdeck/webhook-skills
require('dotenv').config({ quiet: true });
const crypto = require('crypto');
const express = require('express');

const app = express();

/**
 * Constant-time string comparison. Hashing both sides first gives equal-length
 * buffers, so timingSafeEqual never throws and the credential's length isn't leaked.
 */
function safeEqual(a, b) {
  const ha = crypto.createHash('sha256').update(String(a)).digest();
  const hb = crypto.createHash('sha256').update(String(b)).digest();
  return crypto.timingSafeEqual(ha, hb);
}

/**
 * Workspace ONE UEM does not sign event notifications. It sends the User Name and
 * Password from the Event Notifications rule as HTTP Basic auth:
 *   Authorization: Basic base64(username:password)
 * Omnissa's page doesn't say whether they arrive on the first request or only after
 * a 401 challenge, so check the headers of a test notification.
 */
function verifyWorkspaceOneRequest(
  headers,
  username = process.env.WORKSPACE_ONE_WEBHOOK_USERNAME,
  password = process.env.WORKSPACE_ONE_WEBHOOK_PASSWORD
) {
  if (!username || !password) return false; // never accept when unconfigured

  const match = /^basic\s+([A-Za-z0-9+/]+={0,2})$/i.exec((headers.authorization || '').trim());
  if (!match) return false;

  const decoded = Buffer.from(match[1], 'base64').toString('utf8');
  const colon = decoded.indexOf(':'); // split on the FIRST colon; passwords may contain ':'
  if (colon === -1) return false;

  // Evaluate both comparisons before deciding (no short-circuit).
  const userOk = safeEqual(decoded.slice(0, colon), username);
  const passOk = safeEqual(decoded.slice(colon + 1), password);
  return userOk && passOk;
}

/**
 * Omnissa documents the event labels but no payload, so this reads no field from the
 * body. Store the raw body and Content-Type, then write your parser from real
 * notifications captured from your tenant.
 */
function storeNotification(rawBody, contentType) {
  console.log(`Workspace ONE notification: ${rawBody.length} bytes, ${contentType}`);
}

// Read the body raw (any content type) so the request is authenticated before parsing.
app.post('/webhooks/workspace-one', express.raw({ type: '*/*' }), (req, res) => {
  if (!verifyWorkspaceOneRequest(req.headers)) {
    return res.status(401).json({ error: 'Invalid or missing Basic credentials' });
  }

  try {
    const rawBody = Buffer.isBuffer(req.body) ? req.body.toString('utf8') : '';
    storeNotification(rawBody, req.get('content-type'));
  } catch (err) {
    console.error('Error storing Workspace ONE notification:', err);
    return res.status(500).json({ error: 'Handler error' });
  }

  res.status(200).json({ received: true });
});

app.get('/health', (req, res) => {
  res.json({ status: 'ok' });
});

module.exports = app;
module.exports.verifyWorkspaceOneRequest = verifyWorkspaceOneRequest;

if (require.main === module) {
  const PORT = process.env.PORT || 3000;
  app.listen(PORT, () => {
    console.log(`Server running on http://localhost:${PORT}`);
    console.log(`Webhook endpoint: POST http://localhost:${PORT}/webhooks/workspace-one`);
  });
}
nextjs/app/webhooks/workspace-one/route.ts
typescript
// Generated with: workspace-one-webhooks skill
// https://github.com/hookdeck/webhook-skills
import { NextRequest, NextResponse } from 'next/server';
import { verifyWorkspaceOneRequest } from '../../../lib/verify-workspace-one';

/**
 * Omnissa documents the event labels but no payload, so this reads no field from the
 * body. Store the raw body and Content-Type, then write your parser from real
 * notifications captured from your tenant.
 */
function storeNotification(rawBody: string, contentType: string | null): void {
  console.log(`Workspace ONE notification: ${rawBody.length} bytes, ${contentType}`);
}

export async function POST(request: NextRequest) {
  // Authenticate before reading the body.
  if (!verifyWorkspaceOneRequest(request.headers)) {
    return NextResponse.json({ error: 'Invalid or missing Basic credentials' }, { status: 401 });
  }

  try {
    // Read as text so any content type is accepted.
    storeNotification(await request.text(), request.headers.get('content-type'));
  } catch (err) {
    console.error('Error storing Workspace ONE notification:', err);
    return NextResponse.json({ error: 'Handler error' }, { status: 500 });
  }

  return NextResponse.json({ received: true });
}
fastapi/main.py
python
# Generated with: workspace-one-webhooks skill
# https://github.com/hookdeck/webhook-skills
import base64
import binascii
import hmac
import os
import re

from dotenv import load_dotenv
from fastapi import Depends, FastAPI, HTTPException, Request

load_dotenv()

app = FastAPI()

BASIC_RE = re.compile(r"^basic\s+(\S+)$", re.IGNORECASE)


def verify_workspace_one_request(headers, username=None, password=None) -> bool:
    """Workspace ONE UEM does not sign event notifications. It sends the User Name and
    Password from the Event Notifications rule as HTTP Basic auth:
        Authorization: Basic base64(username:password)
    Omnissa's page doesn't say whether they arrive on the first request or only after
    a 401 challenge, so check the headers of a test notification.
    """
    username = username if username is not None else os.environ.get("WORKSPACE_ONE_WEBHOOK_USERNAME")
    password = password if password is not None else os.environ.get("WORKSPACE_ONE_WEBHOOK_PASSWORD")
    if not username or not password:
        return False  # never accept when unconfigured

    match = BASIC_RE.match((headers.get("authorization") or "").strip())
    if not match:
        return False
    try:
        decoded = base64.b64decode(match.group(1), validate=True)
    except (binascii.Error, ValueError):
        return False

    user_b, sep, pass_b = decoded.partition(b":")  # split on the FIRST colon
    if not sep:
        return False

    # compare_digest on bytes (str raises on non-ASCII). Evaluate both before deciding.
    user_ok = hmac.compare_digest(user_b, username.encode("utf-8"))
    pass_ok = hmac.compare_digest(pass_b, password.encode("utf-8"))
    return user_ok and pass_ok


async def require_workspace_one_auth(request: Request) -> None:
    """FastAPI dependency: reject the request before the body is parsed."""
    if not verify_workspace_one_request(request.headers):
        raise HTTPException(status_code=401, detail="Invalid or missing Basic credentials")


def store_notification(raw_body: bytes, content_type) -> None:
    """Omnissa documents the event labels but no payload, so this reads no field from the
    body. Store the raw body and Content-Type, then write your parser from real
    notifications captured from your tenant.
    """
    print(f"Workspace ONE notification: {len(raw_body)} bytes, {content_type}")


@app.post("/webhooks/workspace-one", dependencies=[Depends(require_workspace_one_auth)])
async def workspace_one_webhook(request: Request):
    # Read the raw body so any content type is accepted.
    raw_body = await request.body()

    try:
        store_notification(raw_body, request.headers.get("content-type"))
    except Exception as err:  # noqa: BLE001
        print(f"Error storing Workspace ONE notification: {err}")
        raise HTTPException(status_code=500, detail="Handler error")

    return {"received": True}


@app.get("/health")
async def health():
    return {"status": "ok"}


if __name__ == "__main__":
    import uvicorn

    uvicorn.run(app, host="0.0.0.0", port=8000)

From hookdeck/webhook-skills ↗

Or install the Workspace ONE (Omnissa) webhooks skill:

npx skills add hookdeck/webhook-skills --skill workspace-one-webhooks

Common failures

Credentials changed on one side

Editing the User Name or Password on the rule doesn't change your stored values. Update both together.

Rule inherited from a parent group

Rules follow the organization group hierarchy, so a child group can inherit a rule whose credentials you didn't set there. Check which group's settings apply.

Password split on the wrong colon

Decode the base64 and split on the first colon only, because a password can contain one.

Credentials missing from the first request

Omnissa doesn't say whether it sends Basic credentials up front or only after a 401 challenge. Log the headers of a test notification to see what arrives.

From Hookdeck's Workspace ONE (Omnissa) guide

Let Event Gateway check Workspace ONE's Basic credentials.

Event Gateway checks the rule's user name and password on each Workspace ONE request before it reaches your service, then queues it and retries failures on your schedule.

Not affiliated with Workspace ONE (Omnissa). Facts are compiled from public sources and linked inline.