Member Junction
    Preparing search index...
    • Verifies a Vonage webhook JWT (HS256, signed with the signature secret) and returns its claims, or null when the token is malformed, mis-signed, or expired. Verifies the HS256 signature + exp directly (no JWT library): split header.payload.signature, recompute HMAC-SHA256(header.payload) base64url, constant-time-compare, then check expiry.

      Parameters

      • signatureSecret: string

        The Vonage signature secret (the HS256 HMAC key; resolved upstream — never inlined).

      • bearerToken: string

        The Authorization: Bearer <token> value (or the raw token).

      • nowSeconds: number

        The current epoch seconds (injected so the check is deterministic in tests).

      Returns VonageJwtClaims

      The verified claims, or null when verification fails.