# goauthentik/authentik architecture

> Architecture diagram of the GitHub repository goauthentik/authentik, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goauthentik/authentik
- Repository: https://github.com/goauthentik/authentik

## Overview

authentik is a self-hosted identity provider for SSO. Its central user-facing path is configurable flow execution: users interact with stages to authenticate or enroll, while policies can govern access. The repository also includes protocol providers, endpoint connectors, administrative APIs, blueprints, and event notifications. The graph preserves those documented product branches and sampled internal layers; unsampled subsystem links are omitted or marked unverified rather than inferred from directory names.

Main entry points: [`authentik/flows/views/executor.py`](https://github.com/goauthentik/authentik/blob/main/authentik/flows/views/executor.py) (Flow executor), [`authentik/flows/stage.py`](https://github.com/goauthentik/authentik/blob/main/authentik/flows/stage.py) (Flow stages), [`authentik/core/models.py`](https://github.com/goauthentik/authentik/blob/main/authentik/core/models.py) (Users and groups), [`authentik/core/sources/flow_manager.py`](https://github.com/goauthentik/authentik/blob/main/authentik/core/sources/flow_manager.py) (Identity sources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity workflows"]
  node_flow[("Flow definitions<br/>[models.py]")]
  node_planner["Flow planner<br/>[planner.py]"]
  node_executor["Flow executor<br/>[executor.py]"]
  node_stages["Flow stages<br/>[stage.py]"]
  node_sources["Identity sources<br/>[flow_manager.py]"]
  node_core[("Users and groups<br/>[models.py]")]
end

subgraph group_control["Access and endpoints"]
  node_policy["Policy engine<br/>[engine.py]"]
  node_endpoint["Endpoint connectors<br/>[controller.py]"]
  node_agent["Agent connector<br/>[controller.py]"]
end

subgraph group_protocols["SSO protocols"]
  node_protocols["SSO providers"]
  node_ldap["LDAP outpost<br/>[main.go]"]
  node_radius["RADIUS outpost<br/>[main.go]"]
  node_saml["SAML support"]
end

subgraph group_operations["Administration and operations"]
  node_blueprints["Blueprint management"]
  node_events[("Events and notifications<br/>[models.py]")]
  node_admin["Admin APIs"]
  node_files["File storage<br/>[manager.py]"]
  node_config["Configuration<br/>[config.py]"]
end

node_user(("User"))

node_user -.->|"starts flow"| node_executor
node_executor -.->|"plans stages"| node_planner
node_executor -.->|"runs stages"| node_stages
node_stages -->|"uses executor"| node_executor
node_sources -->|"matches identities"| node_core
node_sources -->|"resumes flow"| node_planner
node_agent -->|"uses controller"| node_endpoint
node_endpoint -->|"provides stage views"| node_stages
node_policy -->|"evaluates identities"| node_core
node_protocols -.->|"offers SSO"| node_user
node_ldap -.->|"serves LDAP"| node_user
node_radius -.->|"serves RADIUS"| node_user
node_saml -.->|"supports SAML"| node_user
node_blueprints -.->|"configures flows"| node_flow
node_admin -.->|"administers identity"| node_core
node_files -->|"reads settings"| node_config
node_events -.->|"notifies users"| node_user

click node_flow "https://github.com/goauthentik/authentik/blob/main/authentik/flows/models.py"
click node_planner "https://github.com/goauthentik/authentik/blob/main/authentik/flows/planner.py"
click node_executor "https://github.com/goauthentik/authentik/blob/main/authentik/flows/views/executor.py"
click node_stages "https://github.com/goauthentik/authentik/blob/main/authentik/flows/stage.py"
click node_sources "https://github.com/goauthentik/authentik/blob/main/authentik/core/sources/flow_manager.py"
click node_core "https://github.com/goauthentik/authentik/blob/main/authentik/core/models.py"
click node_policy "https://github.com/goauthentik/authentik/blob/main/authentik/policies/engine.py"
click node_endpoint "https://github.com/goauthentik/authentik/blob/main/authentik/endpoints/controller.py"
click node_agent "https://github.com/goauthentik/authentik/blob/main/authentik/endpoints/connectors/agent/controller.py"
click node_protocols "https://github.com/goauthentik/authentik/tree/main/authentik/providers"
click node_ldap "https://github.com/goauthentik/authentik/blob/main/cmd/ldap/main.go"
click node_radius "https://github.com/goauthentik/authentik/blob/main/cmd/radius/main.go"
click node_saml "https://github.com/goauthentik/authentik/tree/main/authentik/common/saml"
click node_blueprints "https://github.com/goauthentik/authentik/tree/main/authentik/blueprints/v1"
click node_events "https://github.com/goauthentik/authentik/blob/main/authentik/events/models.py"
click node_admin "https://github.com/goauthentik/authentik/tree/main/authentik/admin/api"
click node_files "https://github.com/goauthentik/authentik/blob/main/authentik/admin/files/manager.py"
click node_config "https://github.com/goauthentik/authentik/blob/main/authentik/lib/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flow,node_planner,node_executor,node_stages,node_sources,node_core,node_user toneBlue
class node_policy,node_endpoint,node_agent toneAmber
class node_protocols,node_ldap,node_radius,node_saml toneMint
class node_blueprints,node_events,node_admin,node_files,node_config toneRose
```

## Components

### Identity workflows

- [Flow definitions](https://github.com/goauthentik/authentik/blob/main/authentik/flows/models.py): `authentik/flows/models.py`
- [Flow planner](https://github.com/goauthentik/authentik/blob/main/authentik/flows/planner.py): `authentik/flows/planner.py`
- [Flow executor](https://github.com/goauthentik/authentik/blob/main/authentik/flows/views/executor.py): `authentik/flows/views/executor.py`
- [Flow stages](https://github.com/goauthentik/authentik/blob/main/authentik/flows/stage.py): `authentik/flows/stage.py`
- [Identity sources](https://github.com/goauthentik/authentik/blob/main/authentik/core/sources/flow_manager.py): `authentik/core/sources/flow_manager.py`
- [Users and groups](https://github.com/goauthentik/authentik/blob/main/authentik/core/models.py): `authentik/core/models.py`

### Access and endpoints

- [Policy engine](https://github.com/goauthentik/authentik/blob/main/authentik/policies/engine.py): `authentik/policies/engine.py`
- [Endpoint connectors](https://github.com/goauthentik/authentik/blob/main/authentik/endpoints/controller.py): `authentik/endpoints/controller.py`
- [Agent connector](https://github.com/goauthentik/authentik/blob/main/authentik/endpoints/connectors/agent/controller.py): `authentik/endpoints/connectors/agent/controller.py`

### SSO protocols

- [SSO providers](https://github.com/goauthentik/authentik/tree/main/authentik/providers): `authentik/providers`
- [LDAP outpost](https://github.com/goauthentik/authentik/blob/main/cmd/ldap/main.go): `cmd/ldap/main.go`
- [RADIUS outpost](https://github.com/goauthentik/authentik/blob/main/cmd/radius/main.go): `cmd/radius/main.go`
- [SAML support](https://github.com/goauthentik/authentik/tree/main/authentik/common/saml): `authentik/common/saml`

### Administration and operations

- [Blueprint management](https://github.com/goauthentik/authentik/tree/main/authentik/blueprints/v1): `authentik/blueprints/v1`
- [Events and notifications](https://github.com/goauthentik/authentik/blob/main/authentik/events/models.py): `authentik/events/models.py`
- [Admin APIs](https://github.com/goauthentik/authentik/tree/main/authentik/admin/api): `authentik/admin/api`
- [File storage](https://github.com/goauthentik/authentik/blob/main/authentik/admin/files/manager.py): `authentik/admin/files/manager.py`
- [Configuration](https://github.com/goauthentik/authentik/blob/main/authentik/lib/config.py): `authentik/lib/config.py`

### Other components

- **User**

## Connections

- User → Flow executor: starts flow
- Flow executor → Flow planner: plans stages
- Flow executor → Flow stages: runs stages (evidence: `authentik/flows/stage.py`)
- Flow stages → Flow executor: uses executor (evidence: `authentik/flows/stage.py`)
- Identity sources → Users and groups: matches identities (evidence: `authentik/core/sources/flow_manager.py`)
- Identity sources → Flow planner: resumes flow (evidence: `authentik/core/sources/flow_manager.py`)
- Agent connector → Endpoint connectors: uses controller (evidence: `authentik/endpoints/connectors/agent/controller.py`)
- Endpoint connectors → Flow stages: provides stage views (evidence: `authentik/endpoints/controller.py`)
- Policy engine → Users and groups: evaluates identities (evidence: `authentik/policies/engine.py`)
- SSO providers → User: offers SSO (evidence: `README.md`)
- LDAP outpost → User: serves LDAP (evidence: `README.md`)
- RADIUS outpost → User: serves RADIUS (evidence: `README.md`)
- SAML support → User: supports SAML (evidence: `README.md`)
- Blueprint management → Flow definitions: configures flows
- Admin APIs → Users and groups: administers identity
- File storage → Configuration: reads settings (evidence: `authentik/admin/files/manager.py`)
- Events and notifications → User: notifies users
