CAI Technology
Menu ☰
cai-auth · · 11 min read

Self-Hosting Your Identity Provider: Sovereignty and Security Trade-offs (2026)

An honest look at self-hosting an IdP: control and sovereignty vs ops burden, with a neutral Keycloak vs Authentik vs CAI-AUTH comparison.

CAI Technology
A bright engineering office where a team reviews a self-hosted identity provider deployment on screens by a sunlit window.

Self-Hosting Your Identity Provider: Sovereignty and Security Trade-offs (2026)

TL;DR

What is a self-hosted identity provider?

A self-hosted identity provider is an authentication and single sign-on server that you deploy and operate on infrastructure you control — your own servers, your own cloud tenancy, or an on-prem datacenter — rather than consuming it as a vendor’s SaaS. You own the database, the signing keys, the upgrade cadence, and the security perimeter. In exchange for that control and data sovereignty, you accept the operational responsibility of keeping an internet-facing root of trust patched, monitored, and highly available.

That trade-off — control and sovereignty versus operational burden — is the entire decision. This article walks through it fairly, then puts three self-hostable OIDC providers side by side on a neutral matrix: Keycloak, Authentik, and CAI-AUTH.

Why self-host an IdP at all?

Three motivations dominate, and they are all legitimate:

If none of those three apply strongly to you, self-hosting is probably the wrong default — and we say so plainly in the “when managed beats self-host” section.

The hidden operational cost

The brochure version of self-hosting is “download, deploy, done.” The reality is that an IdP is a root of trust, and running one well is closer to running a small bank vault than a stateless web app. The hidden costs:

flowchart TD A["Do you need sovereignty, custom flows, or fixed cost?"] -->|"No"| M["Use a managed IdP"] A -->|"Yes"| B["Do you have 24/7 ops + on-call?"] B -->|"No"| C["Can you fund a managed EU-operated provider?"] C -->|"Yes"| M C -->|"No"| D["Re-scope: managed-then-migrate later"] B -->|"Yes"| E["Can you do HSM key mgmt + fast patching?"] E -->|"No"| F["Start managed, build ops maturity first"] E -->|"Yes"| G["Self-host is a sound choice"] G --> H["Pick on: PQ readiness, attestation, EU operation, license"]

How to read this diagram: This decision tree separates the “should I self-host” question from the “which product” question, because conflating them is the most common mistake teams make. It starts by testing whether your motivations (sovereignty, customization, cost) are real, then gates self-hosting behind two hard operational capabilities: round-the-clock availability and disciplined key management plus patching. If you cannot meet those gates, the honest answer is to start managed and build operational maturity before taking custody of a root of trust. Only teams that pass both gates reach the final node — choosing a self-hosted product on the criteria that actually matter in 2026.

Comparison matrix: Keycloak vs Authentik vs CAI-AUTH

Let us be fair about the incumbents first. Keycloak (a Red Hat / CNCF-adjacent project) is the default self-hosted IdP for a reason: it is mature, battle-tested, OpenID-certified, supports a vast protocol surface (OIDC, OAuth 2.x, SAML, LDAP/Kerberos federation), has a deep extension ecosystem, and an enormous community. If your requirement is “a proven, fully featured classical IdP I can run myself,” Keycloak is hard to beat — see the Keycloak documentation. Authentik is a newer, Python-based self-hosted provider with a cleaner admin UX, flexible flow builder, and a lighter footprint; it is an excellent choice for teams who find Keycloak heavy — see the Authentik documentation.

CAI-AUTH does not compete on raw feature count, and we will not pretend otherwise. It is a standalone identity provider written in Rust on the axum framework — not a Keycloak fork, plugin, or distribution. Its differentiators are narrow and specific: post-quantum signing, mandatory hardware attestation, and EU operation. CAI Technology is not a government authority.

flowchart LR subgraph Keycloak K1["PQ signing: roadmap/none"] K2["HW attestation: optional"] K3["EU-operated: self-host anywhere"] K4["License: Apache 2.0"] K5["Ops cost: medium-high"] end subgraph Authentik A1["PQ signing: none"] A2["HW attestation: WebAuthn-based"] A3["EU-operated: self-host anywhere"] A4["License: open core + enterprise"] A5["Ops cost: low-medium"] end subgraph CAI-AUTH C1["PQ signing: composite ML-DSA-87 + Ed25519"] C2["HW attestation: mandatory StrongBox/TEE"] C3["EU-operated: EU by design"] C4["License: commercial, self-hostable"] C5["Ops cost: low-medium"] end

How to read this diagram: This matrix lines up the three providers across the five criteria that drive a 2026 self-host decision, so you can see exactly where each one leads and trails. Keycloak and Authentik are both strong, permissively-or-openly licensed classical IdPs that you can run on any infrastructure, including EU soil — their gap is post-quantum signing, which neither ships today. CAI-AUTH trails on breadth and ecosystem maturity but leads on the three narrow axes it was built for: post-quantum-signed tokens (composite CAI-PQ-HYBRID-87-Ed25519), attestation that is mandatory rather than optional, and operation inside the EU by design. The point of the matrix is not to declare a winner but to make the trade-off legible: choose feature breadth and ecosystem, or choose forward-looking cryptography and EU sovereignty, depending on what your threat model and regulators demand.

A few honest clarifications on that matrix:

Security considerations when you self-host

Whichever product you pick, self-hosting moves these responsibilities onto your team. Hold your deployment to a recognized baseline — the OWASP Application Security Verification Standard (ASVS) is the right yardstick — and pay particular attention to:

When managed beats self-host

Self-hosting is not a virtue in itself. Choose a managed provider when:

A reasonable middle path exists: an EU-operated managed offering of a self-hostable product, which gives you sovereignty and a clean migration path to self-hosting later without re-platforming your relying parties. If you are weighing this against US incumbents, the decision-stage comparison in Okta and Auth0 alternatives for EU companies maps the field.

You can inspect CAI-AUTH’s live OIDC surface at auth.caitech.ro or grab the self-host build from the download page to evaluate it on your own infrastructure.

FAQ

What is the best self-hosted identity provider?

There is no single “best” — it depends on your priorities. Keycloak is the most mature and broadly certified choice for classical, full-feature SSO. Authentik suits teams wanting a lighter, modern alternative. CAI-AUTH fits teams whose priorities are post-quantum signing, mandatory hardware attestation, and EU operation rather than maximum feature breadth.

Is Keycloak the only option?

No. Keycloak is the incumbent and an excellent default, but it is one of several self-hostable identity providers. Authentik offers a lighter, more modern alternative, and CAI-AUTH offers a post-quantum, EU-operated option. The right pick depends on whether you optimize for feature breadth and ecosystem, or for forward-looking cryptography and sovereignty.

Can a self-hosted IdP be post-quantum?

Yes. A self-hosted provider can sign its OIDC tokens with post-quantum algorithms. CAI-AUTH does this today using a composite ML-DSA-87 plus Ed25519 signature following the IETF composite-signatures draft, so tokens remain verifiable against classical primitives during the transition while gaining post-quantum protection for the signing root of trust.

Does self-hosting an IdP improve data sovereignty?

It can, but hosting location alone is not sovereignty. Sovereignty depends on who can legally compel access to your data and operations, not just where the servers sit. Self-hosting on infrastructure you control inside your own jurisdiction, with an EU-operated provider, is the strongest combination — covered in detail in our CLOUD Act analysis.


Ready to compare on your own terms? Explore the live post-quantum OIDC discovery document at auth.caitech.ro, or download the self-host build and run it against your own relying parties.

Legal entity: CAI TECHNOLOGY SRL, CUI 50512457.

We start with a 30-minute conversation.

Free AI-readiness audit for companies with 50+ employees. We reply within 24 hours.