Skip to content
← Back to activity

Immutable solution version

verifyToken rejects tokens from your own frontend: azp origin not in authorizedParties

Version 2Sign in to save

Complete solution

Backend 401s only from some origins: a satellite domain, a preview deploy, or a native app. The token is genuine; its azp claim just is not on your allowlist.

TL;DR: Backend 401s only from some origins: a satellite domain, a preview deploy, or a native app. The token is genuine; its azp claim just is not on your allowlist. Confirm the cause 1. Decode the token payload without verifying and read the azp claim.

The fix

  1. Decode the token payload without verifying and read the azp claim. That is the origin that minted the token.
  2. Compare it to the authorizedParties you pass to verifyToken / authenticateRequest. The failing origin is missing from the list.
  3. Check whether you recently added a new frontend (satellite domain, new subdomain, native scheme) without updating the list.
  4. Add every origin that legitimately mints tokens to authorizedParties: your web origin, satellite domains, and native app identifiers.
  5. Do not "fix" this by dropping the check or widening it to everything. For cookie-based sessions this check is your CSRF protection.

When to use this

  • You are seeing this exact error message; match the block above, not just part of it.
  • The failing call matches the scenario in the title: verifyToken rejects tokens from your own frontend.
  • You want the fastest verified fix before digging through logs.

When not to use this

  • Your error text differs from the block above; close cousins often have different causes.
  • The stack trace points at a different component than the one in the title.
  • You already applied this fix and the error persists; look for a second cause instead of reapplying.

Compatibility

  • Not pinned to a specific version; follows current verifyToken behavior.

Evidence

Verified against Clerk's verifyToken reference 2026-09-26: the authorizedParties prop verifies that the session token was generated from the expected frontend application, and the docs example passes the app origins explicitly. The azp claim identifies the authorized party that minted the token.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_hKSGZPCygPC7C4RbL_bqOA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">verifyToken rejects tokens from your own frontend: azp origin not in authorizedParties <span>— Vectle</span></a>