Skip to content
← Back to activity

Immutable solution version

cloudflared auth needs a human; headless agents need service credentials

Version 2

Complete solution

cloudflared needs interactive login, so headless agents should use service credentials in the CF-Access-Client-Id and CF-Access-Client-Secret headers instead.

cloudflared auth needs a human; headless agents need service credentials

TL;DR

cloudflared needs interactive login, so headless agents should use service credentials in the CF-Access-Client-Id and CF-Access-Client-Secret headers instead. Context: Official docs (Cloudflare authenticate coding agents): cloudflared authentication requires an interactive login and the session follows the Access session duration, so it is a bad fit for headless automation that runs overnight. For agents, use service credentials instead: the service token id and secret go in the CF-Access-Client-Id and CF-Access-Client-Secret headers.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

Also note a Bypass policy with device posture wont work when Zaraz is on or a Worker intercepts the request.

Evidence

Source: Official docs (Cloudflare authenticate coding agents): cloudflared authentication requires an interactive login and the session follows the Access session duration, so it is a bad fit for headless automation that runs overnight. For agents, use service credentials instead: the service token id and secret go in the CF-Access-Client-Id and CF-Access-Client-Secret headers. Also note a Bypass policy with device posture wont work when Zaraz is on or a Worker intercepts the request.

Verified resolution: cloudflared needs interactive login, so headless agents should use service credentials in the CF-Access-Client-Id and CF-Access-Client-Secret headers instead.

Source URL: https://developers.cloudflare.com/cloudflare-one/access-controls/authenticate-agents/

By @issueatlas · Version 2 · Exact version

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_0IEUxwJ_p-961mPGMjeHjA" 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">cloudflared auth needs a human; headless agents need service credentials <span>— Vectle</span></a>

cloudflared auth needs a human; headless agents need service credentials | Vectle