# oca/server-auth architecture

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

- Interactive diagram: https://gitdiagram.com/oca/server-auth
- Repository: https://github.com/oca/server-auth

## Overview

server-auth is a collection of Odoo authentication and user-access addons, not one application. Users enter through distinct login, API-request, and administration flows; the addons provide passwordless/admin access, API-key and federated login, session controls, and cross-instance access. SAML’s shown flow routes a browser response through a controller, validates and signs in through the user model, and uses provider configuration and outstanding-request records. Other addon internals are represented from the README and source index; their unsampled wiring is not asserted.

Main entry points: [`auth_saml/controllers/main.py`](https://github.com/oca/server-auth/blob/19.0/auth_saml/controllers/main.py) (SAML routes), [`auth_saml/models/auth_saml_provider.py`](https://github.com/oca/server-auth/blob/19.0/auth_saml/models/auth_saml_provider.py) (SAML provider), [`auth_saml/models/res_users.py`](https://github.com/oca/server-auth/blob/19.0/auth_saml/models/res_users.py) (SAML sign-in), [`auth_oidc/controllers/main.py`](https://github.com/oca/server-auth/blob/19.0/auth_oidc/controllers/main.py) (OIDC login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_federated["Federated Login"]
  node_saml_controller["SAML routes<br/>[main.py]"]
  node_saml_provider["SAML provider"]
  node_saml_users["SAML sign-in<br/>[res_users.py]"]
  node_saml_mapping["Attribute mapping"]
  node_saml_requests[("Outstanding requests")]
  node_oidc_routes["OIDC login<br/>[main.py]"]
  node_oidc_provider["OIDC provider"]
  node_oauth_tokens[("OAuth sessions")]
end

subgraph group_credentials["Credentials &amp; Identity"]
  node_passkey["Admin passkey<br/>[res_users.py]"]
  node_api_http["API authentication<br/>[ir_http.py]"]
  node_api_keys[("API keys<br/>[auth_api_key.py]")]
  node_api_settings["API key settings"]
  node_key_groups[("API key groups")]
  node_case_login["Case-insensitive login<br/>[res_users.py]"]
end

subgraph group_access["Access Controls"]
  node_session_timeout["Session timeout<br/>[ir_http.py]"]
  node_impersonation["Impersonation<br/>[res_users.py]"]
  node_impersonation_ui["User menu<br/>[user_menu.esm.js]"]
  node_impersonation_log[("Impersonation log<br/>[impersonate_log.py]")]
end

subgraph group_remote["Remote Access"]
  node_cross_controller["Cross-connect route<br/>[cross_connect.py]"]
  node_cross_server["Server integration"]
  node_cross_groups[("Remote groups<br/>[res_groups.py]")]
end

subgraph group_audit["User Activity"]
  node_user_log["User action log<br/>[__manifest__.py]"]
end

node_user(("Odoo user"))

node_user -->|"starts login"| node_saml_controller
node_saml_controller -->|"requests auth"| node_saml_provider
node_saml_controller -->|"authenticates response"| node_saml_users
node_saml_provider -->|"records request"| node_saml_requests
node_saml_users -.->|"validates identity"| node_saml_provider
node_user -->|"starts login"| node_oidc_routes
node_oidc_routes -->|"builds auth link"| node_oidc_provider
node_user -->|"keeps sessions"| node_oauth_tokens
node_user -->|"authenticates as account"| node_passkey
node_user -->|"sends API request"| node_api_http
node_api_http -.->|"checks key"| node_api_keys
node_user -.->|"configures keys"| node_api_settings
node_key_groups -->|"groups keys"| node_api_keys
node_user -->|"logs in"| node_case_login
node_user -->|"uses session"| node_session_timeout
node_user -->|"requests impersonation"| node_impersonation_ui
node_impersonation_ui -.->|"initiates action"| node_impersonation
node_impersonation -.->|"records activity"| node_impersonation_log
node_user -->|"opens remote app"| node_cross_controller
node_cross_controller -.->|"requests access"| node_cross_server
node_cross_server -->|"syncs groups"| node_cross_groups
node_user -->|"views actions"| node_user_log

click node_saml_controller "https://github.com/oca/server-auth/blob/19.0/auth_saml/controllers/main.py"
click node_saml_provider "https://github.com/oca/server-auth/blob/19.0/auth_saml/models/auth_saml_provider.py"
click node_saml_users "https://github.com/oca/server-auth/blob/19.0/auth_saml/models/res_users.py"
click node_saml_mapping "https://github.com/oca/server-auth/blob/19.0/auth_saml/models/auth_saml_attribute_mapping.py"
click node_saml_requests "https://github.com/oca/server-auth/blob/19.0/auth_saml/wizards/auth_saml_request.py"
click node_oidc_routes "https://github.com/oca/server-auth/blob/19.0/auth_oidc/controllers/main.py"
click node_oidc_provider "https://github.com/oca/server-auth/blob/19.0/auth_oidc/models/auth_oauth_provider.py"
click node_oauth_tokens "https://github.com/oca/server-auth/blob/19.0/auth_oauth_multi_token/models/auth_oauth_multi_token.py"
click node_passkey "https://github.com/oca/server-auth/blob/19.0/auth_admin_passkey/models/res_users.py"
click node_api_http "https://github.com/oca/server-auth/blob/19.0/auth_api_key/models/ir_http.py"
click node_api_keys "https://github.com/oca/server-auth/blob/19.0/auth_api_key/models/auth_api_key.py"
click node_api_settings "https://github.com/oca/server-auth/blob/19.0/auth_api_key/models/res_config_settings.py"
click node_key_groups "https://github.com/oca/server-auth/blob/19.0/auth_api_key_group/models/auth_api_key_group.py"
click node_case_login "https://github.com/oca/server-auth/blob/19.0/auth_user_case_insensitive/models/res_users.py"
click node_session_timeout "https://github.com/oca/server-auth/blob/19.0/auth_session_timeout/models/ir_http.py"
click node_impersonation "https://github.com/oca/server-auth/blob/19.0/impersonate_login/models/res_users.py"
click node_impersonation_ui "https://github.com/oca/server-auth/blob/19.0/impersonate_login/static/src/js/user_menu.esm.js"
click node_impersonation_log "https://github.com/oca/server-auth/blob/19.0/impersonate_login/models/impersonate_log.py"
click node_cross_controller "https://github.com/oca/server-auth/blob/19.0/cross_connect_client/controllers/cross_connect.py"
click node_cross_server "https://github.com/oca/server-auth/blob/19.0/cross_connect_client/models/cross_connect_server.py"
click node_cross_groups "https://github.com/oca/server-auth/blob/19.0/cross_connect_client/models/res_groups.py"
click node_user_log "https://github.com/oca/server-auth/blob/19.0/user_log_view/__manifest__.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_saml_controller,node_saml_provider,node_saml_users,node_saml_mapping,node_saml_requests,node_oidc_routes,node_oidc_provider,node_oauth_tokens,node_user toneBlue
class node_passkey,node_api_http,node_api_keys,node_api_settings,node_key_groups,node_case_login toneAmber
class node_session_timeout,node_impersonation,node_impersonation_ui,node_impersonation_log toneMint
class node_cross_controller,node_cross_server,node_cross_groups toneRose
class node_user_log toneIndigo
```

## Components

### Federated Login

- [SAML routes](https://github.com/oca/server-auth/blob/19.0/auth_saml/controllers/main.py): `auth_saml/controllers/main.py`
- [SAML provider](https://github.com/oca/server-auth/blob/19.0/auth_saml/models/auth_saml_provider.py): `auth_saml/models/auth_saml_provider.py`
- [SAML sign-in](https://github.com/oca/server-auth/blob/19.0/auth_saml/models/res_users.py): `auth_saml/models/res_users.py`
- [Attribute mapping](https://github.com/oca/server-auth/blob/19.0/auth_saml/models/auth_saml_attribute_mapping.py): `auth_saml/models/auth_saml_attribute_mapping.py`
- [Outstanding requests](https://github.com/oca/server-auth/blob/19.0/auth_saml/wizards/auth_saml_request.py): `auth_saml/wizards/auth_saml_request.py`
- [OIDC login](https://github.com/oca/server-auth/blob/19.0/auth_oidc/controllers/main.py): `auth_oidc/controllers/main.py`
- [OIDC provider](https://github.com/oca/server-auth/blob/19.0/auth_oidc/models/auth_oauth_provider.py): `auth_oidc/models/auth_oauth_provider.py`
- [OAuth sessions](https://github.com/oca/server-auth/blob/19.0/auth_oauth_multi_token/models/auth_oauth_multi_token.py): `auth_oauth_multi_token/models/auth_oauth_multi_token.py`

### Credentials & Identity

- [Admin passkey](https://github.com/oca/server-auth/blob/19.0/auth_admin_passkey/models/res_users.py): `auth_admin_passkey/models/res_users.py`
- [API authentication](https://github.com/oca/server-auth/blob/19.0/auth_api_key/models/ir_http.py): `auth_api_key/models/ir_http.py`
- [API keys](https://github.com/oca/server-auth/blob/19.0/auth_api_key/models/auth_api_key.py): `auth_api_key/models/auth_api_key.py`
- [API key settings](https://github.com/oca/server-auth/blob/19.0/auth_api_key/models/res_config_settings.py): `auth_api_key/models/res_config_settings.py`
- [API key groups](https://github.com/oca/server-auth/blob/19.0/auth_api_key_group/models/auth_api_key_group.py): `auth_api_key_group/models/auth_api_key_group.py`
- [Case-insensitive login](https://github.com/oca/server-auth/blob/19.0/auth_user_case_insensitive/models/res_users.py): `auth_user_case_insensitive/models/res_users.py`

### Access Controls

- [Session timeout](https://github.com/oca/server-auth/blob/19.0/auth_session_timeout/models/ir_http.py): `auth_session_timeout/models/ir_http.py`
- [Impersonation](https://github.com/oca/server-auth/blob/19.0/impersonate_login/models/res_users.py): `impersonate_login/models/res_users.py`
- [User menu](https://github.com/oca/server-auth/blob/19.0/impersonate_login/static/src/js/user_menu.esm.js): `impersonate_login/static/src/js/user_menu.esm.js`
- [Impersonation log](https://github.com/oca/server-auth/blob/19.0/impersonate_login/models/impersonate_log.py): `impersonate_login/models/impersonate_log.py`

### Remote Access

- [Cross-connect route](https://github.com/oca/server-auth/blob/19.0/cross_connect_client/controllers/cross_connect.py): `cross_connect_client/controllers/cross_connect.py`
- [Server integration](https://github.com/oca/server-auth/blob/19.0/cross_connect_client/models/cross_connect_server.py): `cross_connect_client/models/cross_connect_server.py`
- [Remote groups](https://github.com/oca/server-auth/blob/19.0/cross_connect_client/models/res_groups.py): `cross_connect_client/models/res_groups.py`

### User Activity

- [User action log](https://github.com/oca/server-auth/blob/19.0/user_log_view/__manifest__.py): `user_log_view/__manifest__.py`

### Other components

- **Odoo user**

## Connections

- Odoo user → SAML routes: starts login
- SAML routes → SAML provider: requests auth (evidence: `auth_saml/controllers/main.py`)
- SAML routes → SAML sign-in: authenticates response (evidence: `auth_saml/controllers/main.py`)
- SAML provider → Outstanding requests: records request (evidence: `auth_saml/models/auth_saml_provider.py`)
- SAML sign-in → SAML provider: validates identity
- Odoo user → OIDC login: starts login
- OIDC login → OIDC provider: builds auth link (evidence: `auth_oidc/controllers/main.py`)
- Odoo user → OAuth sessions: keeps sessions
- Odoo user → Admin passkey: authenticates as account
- Odoo user → API authentication: sends API request
- API authentication → API keys: checks key
- Odoo user → API key settings: configures keys
- API key groups → API keys: groups keys (evidence: `auth_api_key_group/models/auth_api_key_group.py`)
- Odoo user → Case-insensitive login: logs in
- Odoo user → Session timeout: uses session
- Odoo user → User menu: requests impersonation
- User menu → Impersonation: initiates action
- Impersonation → Impersonation log: records activity
- Odoo user → Cross-connect route: opens remote app
- Cross-connect route → Server integration: requests access
- Server integration → Remote groups: syncs groups (evidence: `cross_connect_client/models/cross_connect_server.py`)
- Odoo user → User action log: views actions
