# rocksolidknowledge/open.identityserver architecture

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

- Interactive diagram: https://gitdiagram.com/rocksolidknowledge/open.identityserver
- Repository: https://github.com/rocksolidknowledge/open.identityserver

## Overview

Open.IdentityServer is a .NET OpenID Connect and OAuth 2.0 authorization server. A client starts an authorization flow; the server validates the request, may involve the user for sign-in and consent, and issues protocol responses and tokens. The product also supports device authorization, discovery, introspection, revocation, pushed authorization requests (PAR), and server-side sessions. The graph includes the documented EF-backed storage option and ASP.NET Identity sample host. Some runtime internals are unsampled, so those links are shown only where documented or evidenced by the provided index.

Main entry points: [`src/Open.IdentityServer/src/Hosting/EndpointRouter.cs`](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Hosting/EndpointRouter.cs) (Endpoint router), [`src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs`](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs) (Account sign-in), [`src/Storage/src/Stores/IClientStore.cs`](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Storage/src/Stores/IClientStore.cs) (Storage abstractions), [`src/Open.IdentityServer/src/Events/Infrastructure/Event.cs`](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Events/Infrastructure/Event.cs) (Event system)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_protocol["Protocol endpoints"]
  node_authorize["Authorization endpoint"]
  node_token["Token endpoint<br/>[TokenEndpoint.cs]"]
  node_discovery["Discovery endpoints"]
  node_api_endpoints["API endpoints<br/>[Endpoints]"]
  node_par["Pushed requests"]
end

subgraph group_interaction["User interaction"]
  node_account["Account sign-in"]
  node_consent["Consent flow"]
  node_device["Device flow"]
  node_grants["Grant management"]
  node_interaction_api["UI interaction API"]
  node_identity["ASP.NET Identity"]
end

subgraph group_state["State and storage"]
  node_session["Server sessions"]
  node_storage["Storage abstractions<br/>[IClientStore.cs]"]
  node_ef_stores["EF stores<br/>[Stores]"]
  node_config_db[("Configuration database")]
  node_grant_db[("Operational database")]
end

subgraph group_platform["Server platform"]
  node_middleware["Request middleware"]
  node_router["Endpoint router<br/>[EndpointRouter.cs]"]
  node_events["Event system<br/>[Event.cs]"]
  node_options["Server options"]
end

node_client(("OIDC client"))
node_browser(("User browser"))
node_api["Protected API"]

node_client -.->|"sends protocol requests"| node_middleware
node_middleware -.->|"dispatches requests"| node_router
node_router -.->|"routes authorization"| node_authorize
node_router -.->|"routes token requests"| node_token
node_router -.->|"routes metadata requests"| node_discovery
node_router -.->|"routes API requests"| node_api_endpoints
node_router -.->|"routes PAR requests"| node_par
node_authorize -.->|"requests user interaction"| node_browser
node_browser -.->|"submits sign-in"| node_account
node_account -->|"gets authorization context"| node_interaction_api
node_account -->|"looks up client"| node_storage
node_account -->|"raises login events"| node_events
node_browser -.->|"submits consent"| node_consent
node_consent -->|"grants or denies consent"| node_interaction_api
node_consent -->|"raises consent events"| node_events
node_browser -.->|"enters device code"| node_device
node_device -->|"raises device events"| node_events
node_grants -->|"revokes user grants"| node_interaction_api
node_grants -->|"retrieves client data"| node_storage
node_grants -->|"raises revocation events"| node_events
node_authorize -.->|"loads client and resources"| node_storage
node_token -.->|"uses server stores"| node_storage
node_par -.->|"stores pushed requests"| node_grant_db
node_session -.->|"cleans session state"| node_grant_db
node_ef_stores -.->|"reads configuration"| node_config_db
node_ef_stores -.->|"persists operational state"| node_grant_db
node_storage -.->|"EF implementation"| node_ef_stores
node_options -.->|"configures server"| node_middleware
node_identity -.->|"provides user sign-in"| node_account
node_token -.->|"issues access tokens"| node_api
node_api -.->|"may introspect tokens"| node_api_endpoints

click node_middleware "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Hosting/IdentityServerMiddleware.cs"
click node_router "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Hosting/EndpointRouter.cs"
click node_authorize "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/AuthorizeEndpoint.cs"
click node_token "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/TokenEndpoint.cs"
click node_discovery "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/DiscoveryEndpoint.cs"
click node_api_endpoints "https://github.com/rocksolidknowledge/open.identityserver/tree/main/src/Open.IdentityServer/src/Endpoints"
click node_par "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/PushedAuthorizationEndpoint.cs"
click node_account "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs"
click node_consent "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Consent/ConsentController.cs"
click node_device "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Device/DeviceController.cs"
click node_grants "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Grants/GrantsController.cs"
click node_interaction_api "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Services/IIdentityServerInteractionService.cs"
click node_events "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Events/Infrastructure/Event.cs"
click node_session "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/HostedServices/SessionCleanupHostedService.cs"
click node_options "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Configuration/DependencyInjection/Options/IdentityServerOptions.cs"
click node_storage "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Storage/src/Stores/IClientStore.cs"
click node_ef_stores "https://github.com/rocksolidknowledge/open.identityserver/tree/main/src/EntityFramework.Storage/src/Stores"
click node_config_db "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/EntityFramework.Storage/src/DbContexts/ConfigurationDbContext.cs"
click node_grant_db "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/EntityFramework.Storage/src/DbContexts/PersistedGrantDbContext.cs"
click node_identity "https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/AspNetIdentity/src/IdentityServerBuilderExtensions.cs"

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_authorize,node_token,node_discovery,node_api_endpoints,node_par,node_client,node_browser toneBlue
class node_account,node_consent,node_device,node_grants,node_interaction_api,node_identity toneAmber
class node_session,node_storage,node_ef_stores,node_config_db,node_grant_db,node_api toneMint
class node_middleware,node_router,node_events,node_options toneRose
```

## Components

### Protocol endpoints

- [Authorization endpoint](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/AuthorizeEndpoint.cs): `src/Open.IdentityServer/src/Endpoints/AuthorizeEndpoint.cs`
- [Token endpoint](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/TokenEndpoint.cs): `src/Open.IdentityServer/src/Endpoints/TokenEndpoint.cs`
- [Discovery endpoints](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/DiscoveryEndpoint.cs): `src/Open.IdentityServer/src/Endpoints/DiscoveryEndpoint.cs`
- [API endpoints](https://github.com/rocksolidknowledge/open.identityserver/tree/main/src/Open.IdentityServer/src/Endpoints): `src/Open.IdentityServer/src/Endpoints`
- [Pushed requests](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Endpoints/PushedAuthorizationEndpoint.cs): `src/Open.IdentityServer/src/Endpoints/PushedAuthorizationEndpoint.cs`

### User interaction

- [Account sign-in](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs): `src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs`
- [Consent flow](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Consent/ConsentController.cs): `src/Open.IdentityServer/host/Quickstart/Consent/ConsentController.cs`
- [Device flow](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Device/DeviceController.cs): `src/Open.IdentityServer/host/Quickstart/Device/DeviceController.cs`
- [Grant management](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/host/Quickstart/Grants/GrantsController.cs): `src/Open.IdentityServer/host/Quickstart/Grants/GrantsController.cs`
- [UI interaction API](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Services/IIdentityServerInteractionService.cs): `src/Open.IdentityServer/src/Services/IIdentityServerInteractionService.cs`
- [ASP.NET Identity](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/AspNetIdentity/src/IdentityServerBuilderExtensions.cs): `src/AspNetIdentity/src/IdentityServerBuilderExtensions.cs`

### State and storage

- [Server sessions](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/HostedServices/SessionCleanupHostedService.cs): `src/Open.IdentityServer/src/HostedServices/SessionCleanupHostedService.cs`
- [Storage abstractions](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Storage/src/Stores/IClientStore.cs): `src/Storage/src/Stores/IClientStore.cs`
- [EF stores](https://github.com/rocksolidknowledge/open.identityserver/tree/main/src/EntityFramework.Storage/src/Stores): `src/EntityFramework.Storage/src/Stores`
- [Configuration database](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/EntityFramework.Storage/src/DbContexts/ConfigurationDbContext.cs): `src/EntityFramework.Storage/src/DbContexts/ConfigurationDbContext.cs`
- [Operational database](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/EntityFramework.Storage/src/DbContexts/PersistedGrantDbContext.cs): `src/EntityFramework.Storage/src/DbContexts/PersistedGrantDbContext.cs`

### Server platform

- [Request middleware](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Hosting/IdentityServerMiddleware.cs): `src/Open.IdentityServer/src/Hosting/IdentityServerMiddleware.cs`
- [Endpoint router](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Hosting/EndpointRouter.cs): `src/Open.IdentityServer/src/Hosting/EndpointRouter.cs`
- [Event system](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Events/Infrastructure/Event.cs): `src/Open.IdentityServer/src/Events/Infrastructure/Event.cs`
- [Server options](https://github.com/rocksolidknowledge/open.identityserver/blob/main/src/Open.IdentityServer/src/Configuration/DependencyInjection/Options/IdentityServerOptions.cs): `src/Open.IdentityServer/src/Configuration/DependencyInjection/Options/IdentityServerOptions.cs`

### Other components

- **OIDC client**
- **User browser**
- **Protected API**

## Connections

- OIDC client → Request middleware: sends protocol requests
- Request middleware → Endpoint router: dispatches requests
- Endpoint router → Authorization endpoint: routes authorization
- Endpoint router → Token endpoint: routes token requests
- Endpoint router → Discovery endpoints: routes metadata requests
- Endpoint router → API endpoints: routes API requests
- Endpoint router → Pushed requests: routes PAR requests
- Authorization endpoint → User browser: requests user interaction
- User browser → Account sign-in: submits sign-in
- Account sign-in → UI interaction API: gets authorization context (evidence: `src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs`)
- Account sign-in → Storage abstractions: looks up client (evidence: `src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs`)
- Account sign-in → Event system: raises login events (evidence: `src/Open.IdentityServer/host/Quickstart/Account/AccountController.cs`)
- User browser → Consent flow: submits consent
- Consent flow → UI interaction API: grants or denies consent (evidence: `src/Open.IdentityServer/host/Quickstart/Consent/ConsentController.cs`)
- Consent flow → Event system: raises consent events (evidence: `src/Open.IdentityServer/host/Quickstart/Consent/ConsentController.cs`)
- User browser → Device flow: enters device code
- Device flow → Event system: raises device events
- Grant management → UI interaction API: revokes user grants
- Grant management → Storage abstractions: retrieves client data
- Grant management → Event system: raises revocation events
- Authorization endpoint → Storage abstractions: loads client and resources
- Token endpoint → Storage abstractions: uses server stores
- Pushed requests → Operational database: stores pushed requests
- Server sessions → Operational database: cleans session state
- EF stores → Configuration database: reads configuration
- EF stores → Operational database: persists operational state
- Storage abstractions → EF stores: EF implementation
- Server options → Request middleware: configures server
- ASP.NET Identity → Account sign-in: provides user sign-in
- Token endpoint → Protected API: issues access tokens
- Protected API → API endpoints: may introspect tokens
