Zitadel as identity provider for Cloudflare Zero Trust

Cloudflare Access can sign users in through Zitadel over OpenID Connect, so internal apps use your own identity system. This page covers the setup sequence, callback URL, policy claims and organization scoping.

On this page

How Cloudflare Access signs users in through Zitadel

Internal applications behind Cloudflare Access should sign users in through your own Zitadel instance rather than a login provider outside your control. You add Zitadel to Cloudflare Zero Trust as an OpenID Connect identity provider, backed by a web application you create in Zitadel, and you register the team callback URL in that application. The callback follows the pattern https://<team-name>.cloudflareaccess.com/cdn-cgi/access/callback, where <team-name> is your Cloudflare Zero Trust team name. Zitadel documents this exact configuration in its Cloudflare Zero Trust guide, so that guide is the natural starting point for the build.

The Cloudflare side of the setup, including where the identity provider form sits and which plans expose it, must be confirmed in your own Cloudflare account, because Cloudflare menus and plan entitlements change. Confirm your team name before you create the Zitadel application, since a mistyped team name produces a callback mismatch that looks like a login failure. Also confirm that the Zitadel instance hosting the application is reachable from Cloudflare's servers over HTTPS with a certificate your users and Cloudflare both trust, because the browser redirect and the token exchange both depend on it.

This page covers three things: how to set up the web application in Zitadel, which claims Cloudflare Access can use in its policies, and how to scope logins to a specific Zitadel organization so that only the right users reach your internal applications. Each of these decisions affects who can get in, so review them with your security team before you enable the provider for production applications.

What you need before connecting Zitadel to Cloudflare Access

Five things have to be in place before you touch either console: a reachable Zitadel instance, a Cloudflare Zero Trust team, administrator access in both, a planned Zitadel organization and project, and an inventory of the internal applications you will protect. Each card below is a check to complete first, because a gap in any one of them usually shows up later as a failed login or a policy that matches the wrong users.

A Zitadel instance on a stable HTTPS domain

Cloudflare Access sends users to Zitadel's authorization endpoint and then receives the token back, so the Zitadel issuer URL must be reachable over HTTPS on a public domain that does not change. Changing the domain later changes the issuer, which breaks the OIDC configuration on the Cloudflare side. If you run Zitadel yourself, confirm the domain, TLS certificate and reverse proxy before you start. If you use Zitadel Cloud, confirm the instance URL and who holds its administrator account.

Self-hosting overview

PostgreSQL in the supported range

This card applies only if you run self-hosted Zitadel. Zitadel uses PostgreSQL as its database, and the documented supported range is versions 14 through 18. Check the database version your Zitadel deployment connects to, not the version you intended to install. An unsupported database version is a common cause of failures during upgrades, so record it in the change plan alongside the Zitadel release.

Supported PostgreSQL versions
14 to 18
Database requirements

Confirmed Zitadel release

Do not assume which Zitadel release you run or which one this integration was tested against. Look up the current release on the releases page, compare it with your running version, and record both in the implementation ticket. Upgrade behavior, console labels and login screens change between releases, so a configuration guide written for one version may need small adjustments on another.

Zitadel releases

Cloudflare Zero Trust team name

Cloudflare Access builds its callback address from your Zero Trust team name, using the pattern https://<team-name>.cloudflareaccess.com/cdn-cgi/access/callback. That callback URL is what you register in the Zitadel application, so the team name must be final before you configure anything. Confirm the team name in the Zero Trust dashboard, check that you have the right account, and note whether a custom domain is in use for the login flow.

Cloudflare Access guide

Administrator access to both consoles

Setup touches two administrative surfaces: the Zitadel console, where you create the organization, project, OIDC web application and any identity provider, and the Cloudflare Zero Trust dashboard, where you add the identity provider and write Access policies. Confirm that the people doing the work hold administrator roles in both, and that at least one second person can act if the primary administrator is unavailable. Record who approves changes to login settings.

Organization, project and application inventory

Plan the Zitadel organization that holds your workforce or partner users and the project that groups the Cloudflare Access application. Then list every internal application that Access will protect, with its hostname, owner and the groups or roles that should reach it. This list drives the claims and policy design later. A missing application discovered after go-live usually means a new Access application and a new policy review.

Organizations in Zitadel

How a Cloudflare Access login reaches Zitadel

The flow starts when a user opens an internal application protected by Cloudflare Access. Cloudflare redirects the browser to the customer-controlled Zitadel instance for OpenID Connect sign-in. After authentication, Zitadel returns the user to the team callback URL under cloudflareaccess.com, where Cloudflare reads the identity claims and evaluates the Access policy before the application is reached. Check the trust boundary: Zitadel is the only component you operate, and the callback URL must match the one registered in Zitadel.

Login path from browser through Cloudflare Access to Zitadel and back.

Configuring the Zitadel web application for Cloudflare Access

This sequence takes a Zitadel organization from an empty project to a working OpenID Connect login that Cloudflare Access uses to protect an internal application. Each step ends with a check so the team knows whether to continue.

  1. Select the organization and project in Zitadel

    An administrator signs in to the Zitadel console and either selects the organization that will own the internal applications or creates one. Inside that organization, create or select a project to hold the Cloudflare Access application and its roles. Keep the organization aligned with the users who will sign in, because Zitadel scopes users and projects to organizations. Confirm the exact console labels for organizations and projects against the official Zitadel Cloudflare guide before you start, since those labels are not listed in this sequence. Done means the project appears under the intended organization and is ready to receive an application.

  2. Add the web application using OpenID Connect

    Inside the project, add a new application and choose the web application type with the OpenID Connect method. The Zitadel Cloudflare guide documents this method, and the choice of authentication method for the client (such as basic or PKCE) should follow what that guide specifies for Cloudflare. Record the application type and authentication settings in your configuration notes so a later reviewer can compare them with the guide. Done means the application is listed in the project with OpenID Connect selected and not yet in use by any user.

  3. Set the Cloudflare callback as the redirect URI

    Enter the default redirect URI for your Cloudflare team, which takes the form of your team name under cloudflareaccess.com followed by the Access callback path documented in the Zitadel guide. Replace the team name with the value shown in your Cloudflare Zero Trust account, and do not use a placeholder in production. A mismatch here is the most common reason the callback fails, so copy the value exactly rather than retyping it. Done means the redirect URI on the Zitadel application matches the callback Cloudflare expects character for character.

  4. Store the client ID and secret in a secrets store

    After the application is saved, Zitadel shows the client ID and client secret. Copy both into your organization's secrets store, with access limited to the administrators who manage the Cloudflare identity provider. Do not paste the secret into tickets, chat or a shared document, and do not leave it on a screen that others can see. If the client secret is later rotated, the Cloudflare identity provider must be updated with the new value. Done means both values are stored in the approved location and the team can retrieve them without exposing them in plain text.

  5. Add the Zitadel issuer and OIDC settings to Cloudflare

    In Cloudflare Zero Trust, add a new identity provider of the OpenID Connect type. Enter the Zitadel issuer URL for your instance, along with the client ID and secret from the previous step. Confirm the exact Cloudflare field names against the official guide, since they are not listed here. Use the issuer and discovery details shown by your own Zitadel instance rather than copying values from an example. Done means the identity provider is saved in Cloudflare without configuration errors.

  6. Run the test login from the identity provider screen

    From the Cloudflare identity provider screen, use the built-in test option to start a login. The browser should redirect to Zitadel, prompt for a user from the organization in scope, and return to Cloudflare. Use a test account that belongs to the organization, not a shared administrator account. If the test fails, check the redirect URI, the issuer URL and the client secret in that order, and correct only the value that does not match. Done means the test completes and Cloudflare shows the user identity it received from Zitadel.

  7. Attach an Access policy to one internal application

    Create or select a Cloudflare Access application for one internal app, and attach a policy that allows the test user or group through the Zitadel identity provider. Start with a single application so that any problem with claims, groups or organization scoping is easy to isolate. Check that a user outside the allowed group is denied access. Done means the allowed user reaches the internal app after signing in through Zitadel, and the denied user is blocked, which confirms the policy works end to end before you extend it to other applications.

Which Zitadel claims feed Cloudflare Access policies

This table maps the identity data Zitadel can send to Cloudflare Access against what each value is used for in an Access decision. Claim names and whether a role or group claim is emitted depend on your Zitadel project and application settings and on the Cloudflare identity provider fields, so confirm each one with a test login before writing a policy. Treat every row as a check to complete, not a value to assume.

Zitadel sourceWhat Cloudflare Access uses it forWhat to confirm
Subject or user identifier (sub)Identifies the user across sessions and logs; stable reference for the sessionConfirm which value arrives in the test token and that it does not change if the user is renamed
Email addressMatches email-based Access policies such as allowing a specific domain or named usersConfirm the email claim is present, verified in Zitadel, and matches the address your policies list
NameDisplayed in Access logs and the user's session identityConfirm the claim is populated for your test users; policies should not depend on it
Group or role claimsMatches group-based policies when your Zitadel setup emits themConfirm whether a role or group claim is emitted at all, its exact claim name, and how Cloudflare maps it to a policy field
Organization contextLimits which users from which Zitadel organization can reach the applicationConfirm the organization the test user belongs to and whether your Zitadel setup adds organization information to the token
Application and project settingsControl which claims are issued and which roles reach the tokenConfirm the role and claim options on the Zitadel project and web application before relying on them in a policy
Cloudflare identity provider fieldsTell Access which token values to read for each policy conditionConfirm the field mappings you entered match the claim names observed in a test token or test login

Scoping Cloudflare logins to one Zitadel organization

The organization boundary decides which users can reach the Cloudflare application at all, so decide it before you configure the OIDC web application. In Zitadel, an instance holds the tenant, organizations inside it hold users and projects, and the projects hold the applications, roles and grants that Cloudflare Access relies on. Users from a different organization do not see the project that contains your Cloudflare application, so they cannot start a login through it. Confirm the organization that owns the project and the users you intend to admit before you register the callback URL.

For workforce staff, a single internal organization is usually the simplest model. Staff accounts, the project and the Cloudflare application sit together, and access is controlled by the grants and roles you assign to that project. Partners or business customers who need access to a different set of internal applications are better kept in separate organizations, with their own identity providers and users, and granted only the projects they need. The trade-off is administration: each organization carries its own users, providers and grants, so the number of organizations should follow real access boundaries, not team charts. Ask your Zitadel administrators to confirm how grants are issued across organizations in your instance before you decide.

Keep the Cloudflare Access policy and the Zitadel grant or role describing the same people. Zitadel can restrict who is allowed to authenticate against the application, while Cloudflare decides which claims or identities match a given application policy. If a user passes Zitadel login but holds no role in the project, or a policy allows a group that Zitadel never issues, the result is either a denied user or an unintended grant. Test with one user from each organization, record the claims Cloudflare receives, and confirm both layers reject an account that should not pass. The Zitadel organizations documentation describes how these objects nest and is the reference to check against your instance version.

Choosing a policy model for each internal app

This model fits a single employer whose staff sign in to several internal applications behind Cloudflare Access. In Zitadel, keep one organization for the workforce and place the applications in one project, so every app shares the same user pool and the same role names. Cloudflare then decides access with rules that check the identity provider and the email domain, which is usually enough when every person in the group is an employee.

  • One organization and one project: Create the workforce organization in Zitadel and a single project that holds the Cloudflare OIDC web application and the other internal apps. Shared roles stay consistent across apps.
  • Identity provider rule: Use the Zitadel identity provider as the login method in the Access application so only logins from this provider pass.
  • Email domain rule: Limit allowed emails to your corporate domain, and confirm that the domain is verified for your workforce users.
  • Group or claim rule: If you need narrower access, use a claim such as a group or role claim that Zitadel includes in the token, and confirm the claim name in your Cloudflare account.
  • Review point: Confirm that a user outside the workforce cannot sign in and that a removed employee loses access on the next login.

Before rollout, confirm each Access policy rule type that your Cloudflare plan and account offer, because the available rule types depend on your account configuration.

Hardening the Zitadel login path behind Cloudflare Access

Cloudflare Access sits in front of your internal apps, and Zitadel supplies the identity behind it. The login path has three weak points: the OIDC client secret, the administrators who can change either side, and the sign-in events that show who got in. The cards below cover the controls that keep each of them under your control.

Keep the client secret in a vault

The OIDC web application in Zitadel issues a client secret that Cloudflare Zero Trust stores to exchange authorization codes. Keep that value in a secrets manager you already operate, not in a shared spreadsheet or a ticket comment. Rotate it through a planned change: create the new secret, update the Cloudflare identity provider, test a login, then retire the old value. Record who holds read access to the vault entry.

Cloudflare guide

Restrict console and team administration

Two administrative surfaces can change this login path: the Zitadel console for the organization that owns the application, and the Cloudflare Zero Trust team that holds the identity provider and Access policies. Grant each to a small named group, separate from people who only use the apps. Review those memberships on a fixed schedule and confirm that no shared administrator account exists on either side.

Require passkeys with password fallback

Zitadel supports passwordless login with passkeys based on FIDO2 and WebAuthn, and it falls back to password login when a user has no passkey. Decide whether the fallback is acceptable for the apps behind Access, then set the policy in Zitadel so that privileged groups must register a passkey. Confirm which login methods your instance enforces, because Access only sees the result of the sign-in.

Limit the redirect URI to the team callback

Register only the callback for your Cloudflare team name, in the form the Zitadel Cloudflare guide documents, and reject wildcard or extra redirect URIs in the application configuration. A broad redirect list lets an attacker send codes to a host you do not control. Check the callback again after any change to the Cloudflare team name or domain, since a mismatch breaks sign-in rather than failing open.

Cloudflare guide

Make Access policies the enforcement point

Zitadel proves who the user is, but Cloudflare Access policies decide which applications that user may reach. Write allow rules based on identity groups or claims, and end with a deny by default. Then test with an account that is authenticated but not in the permitted group, and confirm Access blocks it. Repeat the test after each policy change, because a successful login alone does not prove authorization.

Log sign-in events in both systems

Collect authentication events from Zitadel and from Cloudflare Access into your log platform, and keep the two streams linked by user identifier and time. A denied Access attempt followed by a successful Zitadel login, for example, is a pattern worth alerting on. Confirm retention periods and export options with each vendor, since the documented options vary by deployment and plan.

Why Cloudflare Access login to Zitadel fails

This table pairs each common login failure with its likely cause and a check you can run to confirm it. Work through the rows in order, since the redirect URI and issuer checks rule out most problems before you look at policies or cookies. The main takeaway is that most failures come from a small mismatch between the Zitadel application settings and the Cloudflare team configuration.

SymptomLikely causeCheck and fix
Redirect URI error after choosing Zitadel at the Access login pageTeam name in the callback URI is wrong, or the path was editedCompare the Zitadel redirect URI with https://<team-name>.cloudflareaccess.com/cdn-cgi/access/callback character by character, using the team name shown in your Cloudflare Zero Trust dashboard
Token exchange fails with an invalid client errorClient secret was rotated in Zitadel but not updated in Cloudflare, or was copied with extra spacesGenerate or confirm the current secret in the Zitadel application, paste it into the Cloudflare identity provider settings again, and save
Login page loads but discovery or token calls failIssuer URL points to an internal hostname or a domain that differs from the public Zitadel domainOpen the issuer URL in a browser and confirm the discovery document lists the same public domain that Cloudflare calls; correct the external domain setting in Zitadel
User signs in successfully but Access shows a denied pageAccess policy requires a claim, such as an email domain or group, that the ID token does not containInspect the token claims for a test user and match the policy rule to the exact claim name and value; add the claim through Zitadel actions or adjust the policy
User cannot see the application or gets no login optionUser belongs to a different Zitadel organization than the one the identity provider or application is scoped toConfirm the user's organization in the Zitadel console and check which organization the Cloudflare identity provider and application belong to
Browser loops between Zitadel and the Access login pageCookies blocked or scoped to the wrong domain, or the protected app and team domain do not share the expected parent domainTest in a private window with third-party cookie settings noted, confirm the application domain matches the Access application configuration, and review browser cookie rules for both domains

What does a Zitadel and Cloudflare Access integration take?

What drives the effort of a Zitadel and Cloudflare Access integration?

The effort follows the number of Access applications, the number of Zitadel organizations that will sign in, how many claims your policies need, and whether Zitadel is already running in production. A single internal app with one organization and a simple email or group rule is a small job. Ten apps across several organizations, each with its own policy set, takes longer because every combination needs a clear owner, a test case and a rollback path. A new Zitadel deployment also adds platform work that an existing production instance does not need. Ask any partner to break the quote down by these factors so you can see which ones move the price.

What does our team need to provide before the integration starts?

You need administrator access to both Cloudflare Zero Trust and the Zitadel instance, with rights to create OIDC web applications and to edit Access identity providers. Name one owner for the list of internal apps, their hostnames and the policy each one needs, because most delays come from unclear requirements. Provide a small test group in Zitadel, ideally a few users from different departments, so you can verify sign-in and claim-based rules before real users arrive. Confirm who holds the client secret and where it will be stored, since that decision affects the handover.

Can our own team set up Zitadel with Cloudflare Access using the official guide?

A team with working knowledge of OIDC, Cloudflare Zero Trust and Zitadel can follow the official Zitadel guide for the basic setup. The guide covers the OpenID Connect identity provider configuration and the default redirect URI, which uses your Cloudflare team name. The harder parts are outside the guide: designing claim-based policies, mapping Zitadel organizations to Access rules, testing denial paths and documenting the result for auditors. If your team has no one who has run an OIDC integration before, a fixed-scope engagement can cover those gaps and transfer the knowledge in writing.

How do testing and rollout order affect the timeline?

Testing usually decides the timeline more than the initial configuration does. A safe order starts with one non-critical app in a test organization, then checks sign-in, group and role claims, session length and the behavior for users who should be denied. Only after that does the team add more applications and organizations in stages. Each stage needs a user acceptance window, so the number of rollout waves matters as much as the number of apps. Agree the acceptance criteria and the rollout waves in the written scope so both sides know when each stage is complete.

What recurring work follows go-live for this integration?

Recurring work includes rotating the OIDC client secret on a schedule, reviewing Access policies when people change teams or apps are retired, and checking the integration after Zitadel or Cloudflare changes. Each Zitadel upgrade and each change to organizations, claims or identity providers can affect the sign-in flow, so it needs a regression test against the test group. Access policies drift over time, so a periodic review with the application owners keeps them aligned with current needs. Ask any provider whether this work is included in a retainer or handed back to your team, and who pays for it.

What does a fixed-scope quote for this integration cover?

A fixed-scope quote covers the agreed list of applications, the organizations in scope, the claim and policy design, the configuration work in Zitadel and Cloudflare, testing against the agreed acceptance criteria, documentation and the handover. It should also state what is excluded, such as new apps added later, changes to your identity sources or work outside Cloudflare Access. DeployOpen does not publish a price list, and figures come only from a written scope that both sides approve before work starts. Ask for the scope, deliverables and timeline in writing, and compare quotes on the same list of items.

Which Zitadel settings do engineers check first when Access sign-in fails?

Start with the redirect URI, because Cloudflare Access expects the callback at your team name's cdn-cgi path, and a mismatch stops the flow before any policy runs. Next check the client ID, the client secret and the client authentication method configured in the Zitadel web application. Then inspect the claims the Access policy relies on, such as email, groups or organization-related values, since a missing claim makes an otherwise valid user fail a rule. Keep a list of these checks in your runbook so the on-call team can work through them in order.

How DeployOpen scopes and delivers this integration

DeployOpen treats Zitadel as identity provider for Cloudflare Zero Trust as a written, fixed-scope piece of work inside your own infrastructure. We agree the applications, claims, organization boundaries and policies in writing before configuration starts, then test the login path end to end and hand over what your team needs to run it.

How we scope

  • Inventory the internal applications that will sit behind Cloudflare Access and which ones need Zitadel logins.
  • Confirm the Cloudflare team name, the Zitadel instance and organization model, and which users belong to each organization.
  • Agree in writing which claims Access policies will use, and which fixed scope and deliverables the engagement covers.

How we build

  • Configure the Zitadel OIDC web application, redirect URI and client authentication settings for your Cloudflare team name.
  • Map the Zitadel claims and project roles into Cloudflare Access policies, then test allow and deny paths for each group.
  • Verify sign-in, session behavior and organization scoping in a non-production environment before any production change.

How we hand over

  • Deliver a configuration record covering applications, redirect URIs, claim mappings, policies and the organization structure.
  • Document the change steps your team will repeat, such as adding an application or a new organization, and the checks to run after each.
  • Walk your identity and security staff through the setup and the test evidence so they can review it against your own controls.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer when your Zitadel or Cloudflare setup changes.
  • Retest the Access login path after Zitadel upgrades or changes to the Cloudflare team name and policies.
  • Confirm with your Cloudflare plan and Zitadel edition which features and support terms apply before you commit to a scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.