In Cloudflare Access, what happens when an employee first opens the company wiki, and what reaches the wiki's origin afterwards?
answer
- deny by default
- team domain login page
- identity provider or one-time PIN
- two CF_Authorization cookies
- a JWT header on every request
basics
~20 sAccess stops the request, sends the employee to the team domain's login page to sign in through an identity provider, checks the application's policies, then sets CF_Authorization cookies and forwards each request with a signed JWT in Cf-Access-Jwt-Assertion.
solid answer
~40 sAn Access application covers the wiki's hostname, and Access is deny by default, so a request without a valid `CF_Authorization` cookie never reaches the origin. Access redirects the browser to the team domain, `<team-name>.cloudflareaccess.com`, where the employee picks a login method: the company's identity provider, or a one-time PIN sent by email if that method is enabled. Access then evaluates the application's policies against that identity. On success it issues two tokens: a global session token stored on the team domain, which gives single sign-on to the organisation's other Access applications, and an application token set as a `CF_Authorization` cookie on the wiki's hostname. Every request Access forwards to the origin carries that application token in the `Cf-Access-Jwt-Assertion` header, which the origin should verify.
go deeper
Recall the order: no cookie, redirect to the team domain, sign in, policy check, cookies set, request forwarded with Cf-Access-Jwt-Assertion. Name both tokens and where each is stored.
Explain how the global session gives single sign-on while each application gets its own token, how expiry and silent reissue work, and why the header beats the cookie for reading the token.
Point out that the plain email header is unsigned and that the origin must verify the JWT, since Access protects only requests that pass through it. Mention get-identity for groups.
Frame login methods as a policy choice: the company identity provider for staff, one-time PIN only for named guests, and session lengths matched to each application's sensitivity.
## What Access sits in front of **Cloudflare Access** checks identity at Cloudflare's edge before a request is allowed through to an application. An administrator creates an **Access application** for a hostname, and optionally a path, such as `wiki.example.com`, and attaches **Access policies** that say who may reach it. Every Zero Trust organisation also has a **team domain**, `<team-name>.cloudflareaccess.com`, which hosts the login page and the organisation's signing keys. Two facts shape everything that follows: - Access is **deny by default**: a user must match an Allow policy before any request reaches the origin. - Access checks **every** HTTP request bound for a protected hostname for a valid `CF_Authorization` cookie, not only the first one. ## The first request, step by step 1. The employee opens `https://wiki.example.com`. The browser has no `CF_Authorization` cookie for that hostname, so Access does not forward the request. 2. Access redirects the browser to the team domain's login page. If the application allows a single identity provider and **Apply instant authentication** is on, Access skips the login page and sends the employee straight to that provider. 3. The employee signs in with a login method enabled for the application: the company's identity provider, or a **one-time PIN** that Access emails to an address the policies allow. 4. Access evaluates the application's policies against the identity it now holds: email, identity provider groups and attributes such as country or IP range. 5. If an Allow policy matches, Access issues two signed tokens and sends the browser back to the wiki. 6. The original request now goes through to the origin, carrying the application token. ## The two tokens | Token | Where it lives | What it does | Lifetime setting | |---|---|---|---| | Global session token | Cookie on the team domain | Single sign-on: other Access applications reuse it without another login | Global session duration (default 24 hours, 15 minutes to one month) | | Application token | `CF_Authorization` cookie on `wiki.example.com` | Lets this browser reach this one application | Policy session duration, which defaults to the application session duration (default 24 hours) | When the application token expires, Access issues a new one without a prompt as long as the global session is still valid and the stored identity still passes the policies. Only when the global session has also expired does the employee see the identity provider again. The employee can end both early at `<application-domain>/cdn-cgi/access/logout` or at the team domain's `/cdn-cgi/access/logout`. ## Login methods - **An identity provider** such as the company's single sign-on, connected through OIDC or SAML. This is what employees normally use, and it is what makes identity provider groups available to policies. - **One-time PIN**: Access emails a code to the address the user types. It suits a guest who is not in the company directory. Because anyone can receive a PIN at an email address they control, a policy must still name who is allowed; a policy that merely includes the one-time PIN login method admits everyone. - **The Cloudflare identity provider**: users sign in with their Cloudflare account credentials, restricted to members of the account. Since June 2026 it is the default login method of a newly created Zero Trust organisation, and one-time PIN is no longer added automatically; existing organisations keep the methods they had. ## What the origin receives Every request Access forwards carries the **application token** as a JWT in the `Cf-Access-Jwt-Assertion` request header. Browser requests also carry it as the `CF_Authorization` cookie, but the cookie is not guaranteed to be passed, so the header is the one to read. The token is signed with a key pair unique to the Cloudflare account; its `aud` claim holds the application's **AUD tag** and its `email` claim the user's verified address. Requests also arrive with a plain `Cf-Access-Authenticated-User-Email` header. It is convenient, but it is only an unsigned header: the origin should trust identity only after verifying the JWT, because a request that reaches the origin some other way can carry any header it likes. For the full identity, including all groups, the application can send the `CF_Authorization` cookie to the team domain's `/cdn-cgi/access/get-identity` endpoint. ## What it means for the wiki team The wiki's origin no longer runs a login page of its own. It does still own one job: verifying the token on every request, because Access protects only the requests that pass through it.
- What happens when the wiki's application token expires but the global session is still valid?Access issues a fresh application token without showing a login page, after re-checking the stored identity against the wiki's policies. The employee goes back to the identity provider only when the global session, 24 hours by default and configurable from 15 minutes to one month, has expired too.
- Why should the origin read `Cf-Access-Jwt-Assertion` rather than the `CF_Authorization` cookie?Access adds the header to every request it forwards, while the cookie travels only with browser requests and is not guaranteed to be passed. A nightly job using a service token, or any other non-browser client, may carry no cookie at all, so code that reads only the cookie rejects legitimate callers.
Access works like a staffed reception desk. You show ID once at the front desk and get a building pass, and each office you visit issues its own door badge that opens only that office. The office manager should still check the badge's stamp rather than trust anyone already standing inside.
- Access checks only the first request; afterwards the browser goes straight to the origin.
- The token reaches the origin only as a cookie, so non-browser callers carry no identity.
- The application token lives on the team domain and is shared by every application.
- One-time PIN is a second factor that Access adds on top of the identity provider.
- An Access application admits everyone until someone adds a Block policy.
Assumes Cloudflare Access as of 2026-10-10; since June 2026 new Zero Trust organisations start with the Cloudflare identity provider as the default login method instead of one-time PIN.