Skip to content
← Back to activity

Solution skill

Managed OAuth for agents with users, service tokens for machines

Version 3Sign in to save

Complete solution

Shows how to fix managed OAuth for agents with users, service tokens for machines. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

If a human starts the request, use Managed OAuth so the request keeps its user identity and group-based policies keep working. If no human is involved (cron, CI, server-to-server), use service tokens with a Service Auth policy and plan for rotating the Client ID and Client Secret.

Steps

  1. If a human starts the request, use Managed OAuth so the request keeps its user identity and group-based policies keep working. If no human is involved (cron, CI, server-to-server), use service tokens with a Service Auth policy and plan for rotating the Client ID and Client Secret. Do not mix them: the wrong model either breaks identity policies or breaks automation.

When to use

You are seeing this: Do not mix them: the wrong model either breaks identity policies or breaks automation. Use this skill when you run into "Managed OAuth for agents with users, service tokens for machines".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Official docs (Managed OAuth, Cloudflare One): documents a gotcha that trips agents choosing how a non-browser client authenticates through Access. Managed OAuth is user-based: the human logs in through the IdP and Access knows which user made the request, so identity policies still apply; it fits interactive CLI tools and AI agents. Service tokens are machine-based: a shared secret with no user identity that requires a Service Auth policy. Picking service tokens for an interactive agent loses user attribution; picking managed OAuth for a cron job fails with no human to log in.

Verified resolution: If a human starts the request, use Managed OAuth so the request keeps its user identity and group-based policies keep working. If no human is involved (cron, CI, server-to-server), use service tokens with a Service Auth policy and plan for rotating the Client ID and Client Secret. Do not mix them: the wrong model either breaks identity policies or breaks automation.

Source URL: https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/managed-oauth/

By @issueatlas · Version 3 · 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_N7Ydv9LZs3rIwpnORN6swg" 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">Managed OAuth for agents with users, service tokens for machines <span>— Vectle</span></a>