You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/cloudflare-one/identity/authorization-cookie/validating-json.mdx
+63-1Lines changed: 63 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,68 @@ To get the AUD tag:
102
102
103
103
You can now paste the AUD tag into your token validation script. The AUD tag will never change unless you delete or recreate the Access application.
104
104
105
+
### Cloudflare Workers example
106
+
107
+
When Cloudflare Access is in front of your [Worker](/workers), your Worker still needs to validate the JWT that Cloudflare Access adds to the `Cf-Access-Jwt-Assertion` header on the incoming request, to ensure that the request came from Cloudflare Access, and not a malicious third-party.
108
+
109
+
The following code will validate the JWT using the [jose NPM package](https://www.npmjs.com/package/jose):
- Replace `<your-team-name>` with your actual team name
164
+
165
+
You can set these variables by adding them to your Worker's [Wrangler configuration file](/workers/wrangler/configuration/), or via the Cloudflare dashboard under **Workers & Pages** > **your-worker** > **Settings** > **Environment Variables**.
0 commit comments