You can now enable Access on a Worker or all Workers at once
You now have two new ways to protect your Workers with Cloudflare Access.
Protect an application across all its domains at once
Until now, if a Worker was reachable on a route, a Custom Domain, and a workers.dev URL, you had to manually add each one to an Access application and keep the list in sync whenever routes or domains changed.
Now, Access attaches the policy to the Worker itself, so every associated domain and preview URL stays protected even when its routes or domains change.
Protect all new and existing Workers by default
Make all Workers private by default, so every existing and newly created Worker requires sign-in before anyone can reach it.
If a specific Worker should remain publicly accessible, add a Worker-level bypass to exempt it.
Whether you protect a single application or all Workers at once, you can choose whether to protect preview deployments only or both previews and production, and control who can sign in by Cloudflare account membership, email address, or email domain.
For more advanced policy options, edit the policy in Zero Trust ↗.
View all of your Worker Access policies
You can view and manage all of your Access policies in the Access tab of the Workers & Pages section in the dashboard.
See who is accessing your Worker
When Access is enabled on your Worker, every authenticated request includes ctx.access. Call ctx.access.getIdentity() to get the user's email, name, and groups — no manual JWT validation required.
export default {
async fetch(request, env, ctx) {
if (!ctx.access) {
return new Response("Access did not run", { status: 401 });
}
const identity = await ctx.access.getIdentity();
return Response.json({ aud: ctx.access.aud, email: identity?.email });
},
};Test Access locally
You can now test Cloudflare Access locally with wrangler dev. Add a dev block to your wrangler.jsonc:
{
"access": {
"dev": {
"aud": "my-app",
"identity": { "email": "admin@example.com" }
}
}
}Your Worker will receive this identity through ctx.access and ctx.access.getIdentity(), letting you test authenticated and unauthenticated flows without deploying. Remove the dev block to simulate unauthenticated requests.
API and programmatic access
You can also set up these policies through the Workers API instead of the dashboard.