# mosip/esignet architecture

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

- Interactive diagram: https://gitdiagram.com/mosip/esignet
- Repository: https://github.com/mosip/esignet

## Overview

1. **What this repo is**
   eSignet is an OpenID Connect / OAuth 2.0 authorization server with a companion web UI, built as a modular Java 11 / Maven monorepo. The system is designed around plugin-style integrations so the core protocol engine can be paired with different identity providers and identity databases.

2. **Primary runtime boundary**
   The main deployable backend is **`esignet-service`**. It exposes the HTTP APIs and controllers for authorization, token issuance, client management, consent, key binding, discovery, and system info. This is the application you would place at the center of the architecture diagram.

3. **Protocol engine vs. shared model layer**
   The backend delegates most protocol and domain logic to two shared libraries:
   - **`esignet-core`**: common DTOs, validation annotations, SPI interfaces, cache/security/audit utilities, and protocol constants.
   - **`esignet-integration-api`**: plugin-facing contracts and DTOs for identity exchange, key binding, OTP, VC-related legacy interfaces, and related validation helpers.
   These are the architectural seam between the service and pluggable implementations.

4. **Concrete implementation modules**
   The actual service logic is split into focused implementation jars:
   - **`oidc-service-impl`**: OAuth/OIDC flow orchestration, authorization code, token, discovery, PAR, claims, consent helper logic.
   - **`client-management-service-impl`**: create/update/read client registrations.
   - **`binding-service-impl`**: public-key registry and individual-id binding validation.
   - **`consent-service-impl`**: consent persistence and consent history.
   These modules are the backend’s internal subsystems; the service layer wires them through the SPI interfaces from `esignet-core`.

5. **Request flow through the backend**
   A typical authorization flow enters through `esignet-service` controllers, passes through security/header/DPoP filters, then into the OIDC or client/consent services. Those services coordinate state across cache, database, and external identity/plugin calls, and finally return redirects, codes, tokens, or discovery documents back to the browser or client.

6. **External identity and partner integration**
   eSignet is not a standalone identity store. It depends on external identity ecosystems via plugins and supporting services:
   - partner onboarding and policy management,
   - identity-provider-specific authentication and KYC/binding steps,
   - key binding and consent collection,
   - optional linked / DPoP / PAR variants of the same protocol flow.
   The architecture should show these as external service boundaries rather than internal modules.

7. **Persistence layer**
   The repo includes SQL and upgrade scripts for a dedicated **`mosip_esignet`** database schema. The stored data is centered around client details, consent records, consent history, public key registry, key policies, and related operational metadata. The implementation modules each map to a portion of this shared database.

8. **Cache, messaging, and security dependencies**
   The core code includes Redis cache configuration and Kafka helper utilities, indicating that session-like state, transaction state, or queued actions are offloaded from pure request/response handling. Security concerns include DPoP validation, JWT-based client authentication, CSRF-related handling, and cryptographic key management through SOFTHSM in deployment.

9. **Web UI boundary**
   The **`oidc-ui`** module is a separate React application served independently and deployed alongside the backend. It handles end-user interactions such as login, consent, signup, OTP, biometrics, and authorization screens. It communicates with `esignet-service` over HTTP APIs and should be drawn as a distinct frontend client, not embedded in the backend.

10. **Local development and test harnesses**
   The repo contains extensive testing artifacts:
   - **`api-test`**: Java/TestNG-based API automation with many scenario templates for OIDC, linked auth, DPoP, PAR, consent, and partner flows.
   - **`performance-test`**: JMeter load scripts and test data.
   - **`postman-collection`**: manual/API exploration assets.
   These are not part of production runtime but are important for understanding expected flow coverage.

11. **Deployment topology**
   Production deployment is Kubernetes/Helm-based under **`deploy/`** and **`helm/`**, with charts and scripts for the backend, UI, PostgreSQL, Redis, Kafka, Keycloak, SOFTHSM, and ingress/gateway setup. The architecture therefore spans multiple cluster components rather than a single service pod.

12. **Supporting platform services**
   The deployment and scripts reveal the main platform services the system expects around it:
   - **PostgreSQL** for persistent state,
   - **Redis** for short-lived state/caching,
   - **Kafka** for asynchronous/event-driven support,
   - **Keycloak** for identity/auth infrastructure in the platform setup,
   - **Istio / gateway components** for ingress and routing.
   These are material dependencies for the system architecture diagram.

13. **Important functional boundaries**
   The most important functional partitions are:
   - protocol execution,
   - client lifecycle management,
   - consent lifecycle,
   - key binding / registry,
   - UI-based user interaction,
   - test and deployment automation.
   Keeping these boundaries separate will produce an accurate diagram of how eSignet is assembled and how requests move through it.

14. **Notable scope note**
   The README states that Verifiable Credential Issuance endpoints were moved out to Inji Certify, so this repository should be diagrammed primarily around OIDC/OAuth, identity assurance, consent, binding, and client management rather than VC issuance.

Main entry points: [`esignet-service`](https://github.com/mosip/esignet/tree/master/esignet-service) (eSignet service), [`helm/esignet`](https://github.com/mosip/esignet/tree/master/helm/esignet) (Helm deploy), [`db_scripts/mosip_esignet`](https://github.com/mosip/esignet/tree/master/db_scripts/mosip_esignet) (PostgreSQL), [`oidc-service-impl`](https://github.com/mosip/esignet/tree/master/oidc-service-impl) (OIDC impl)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_esignet_service["eSignet service<br/>backend app"]
  node_oidc_impl["OIDC impl<br/>protocol services"]
  node_client_mgmt_impl["Client mgmt<br/>registry service"]
  node_binding_impl["Key binding<br/>binding service"]
  node_consent_impl["Consent service"]
end

subgraph group_shared["Shared libs"]
  node_esignet_core["Core lib<br/>shared library"]
  node_integration_api["Integration API<br/>spi contracts"]
end

subgraph group_frontend["Frontend"]
  node_oidc_ui["OIDC UI<br/>react app"]
end

subgraph group_platform["Platform"]
  node_postgres[("PostgreSQL<br/>database")]
  node_redis[("Redis<br/>cache")]
  node_kafka["Kafka<br/>messaging"]
  node_keycloak["Keycloak<br/>identity infra"]
  node_istio_gateway{{"Gateway<br/>ingress"}}
  node_softhsm["SoftHSM<br/>crypto HSM"]
end

subgraph group_ops["Ops & quality"]
  node_deploy_helm["Helm deploy<br/>deployment charts"]
  node_db_scripts["DB scripts<br/>schema ops"]
  node_db_upgrade["DB upgrades<br/>migration ops"]
  node_api_test["API tests<br/>automation"]
  node_perf_test["Perf tests<br/>load testing"]
  node_postman["Postman<br/>api exploration"]
end

node_esignet_service -->|"delegates"| node_oidc_impl
node_esignet_service -->|"delegates"| node_client_mgmt_impl
node_esignet_service -->|"delegates"| node_binding_impl
node_esignet_service -->|"delegates"| node_consent_impl
node_esignet_service -->|"uses"| node_esignet_core
node_esignet_service -->|"uses"| node_integration_api
node_oidc_impl -->|"implements"| node_esignet_core
node_oidc_impl -->|"calls plugins"| node_integration_api
node_oidc_impl -->|"caches"| node_redis
node_oidc_impl -->|"publishes"| node_kafka
node_client_mgmt_impl -->|"persists"| node_postgres
node_binding_impl -->|"persists"| node_postgres
node_consent_impl -->|"persists"| node_postgres
node_oidc_ui -->|"calls HTTP"| node_esignet_service
node_deploy_helm -->|"deploys"| node_esignet_service
node_deploy_helm -->|"deploys"| node_oidc_ui
node_deploy_helm -->|"provisions"| node_postgres
node_deploy_helm -->|"provisions"| node_redis
node_deploy_helm -->|"provisions"| node_kafka
node_deploy_helm -->|"provisions"| node_keycloak
node_deploy_helm -->|"routes through"| node_istio_gateway
node_deploy_helm -->|"provisions"| node_softhsm
node_db_scripts -->|"defines schema"| node_postgres
node_db_upgrade -->|"migrates"| node_postgres
node_api_test -->|"validates"| node_esignet_service
node_perf_test -->|"loads"| node_esignet_service
node_postman -->|"explores"| node_esignet_service

click node_esignet_service "https://github.com/mosip/esignet/tree/master/esignet-service"
click node_oidc_impl "https://github.com/mosip/esignet/tree/master/oidc-service-impl"
click node_client_mgmt_impl "https://github.com/mosip/esignet/tree/master/client-management-service-impl"
click node_binding_impl "https://github.com/mosip/esignet/tree/master/binding-service-impl"
click node_consent_impl "https://github.com/mosip/esignet/tree/master/consent-service-impl"
click node_esignet_core "https://github.com/mosip/esignet/tree/master/esignet-core"
click node_integration_api "https://github.com/mosip/esignet/tree/master/esignet-integration-api"
click node_oidc_ui "https://github.com/mosip/esignet/tree/master/oidc-ui"
click node_postgres "https://github.com/mosip/esignet/tree/master/db_scripts/mosip_esignet"
click node_redis "https://github.com/mosip/esignet/tree/master/deploy/redis"
click node_kafka "https://github.com/mosip/esignet/tree/master/deploy/kafka"
click node_keycloak "https://github.com/mosip/esignet/tree/master/deploy/keycloak"
click node_istio_gateway "https://github.com/mosip/esignet/tree/master/deploy/istio-gateway"
click node_softhsm "https://github.com/mosip/esignet/tree/master/deploy/softhsm"
click node_deploy_helm "https://github.com/mosip/esignet/tree/master/helm/esignet"
click node_db_scripts "https://github.com/mosip/esignet/tree/master/db_scripts/mosip_esignet"
click node_db_upgrade "https://github.com/mosip/esignet/tree/master/db_upgrade_script/mosip_esignet/sql"
click node_api_test "https://github.com/mosip/esignet/tree/master/api-test"
click node_perf_test "https://github.com/mosip/esignet/tree/master/performance-test"
click node_postman "https://github.com/mosip/esignet/tree/master/postman-collection"

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_esignet_service,node_oidc_impl,node_client_mgmt_impl,node_binding_impl,node_consent_impl toneBlue
class node_esignet_core,node_integration_api toneAmber
class node_oidc_ui toneMint
class node_postgres,node_redis,node_kafka,node_keycloak,node_istio_gateway,node_softhsm toneRose
class node_deploy_helm,node_db_scripts,node_db_upgrade,node_api_test,node_perf_test,node_postman toneIndigo
```

## Components

### Runtime

Primary deployable application and service modules

- [eSignet service](https://github.com/mosip/esignet/tree/master/esignet-service): backend app · Main HTTP runtime for OIDC/OAuth endpoints, security filters, and controllers. · `esignet-service`
- [OIDC impl](https://github.com/mosip/esignet/tree/master/oidc-service-impl): protocol services · Orchestrates authorization, token, discovery, PAR, claims, and linked flows. · `oidc-service-impl`
- [Client mgmt](https://github.com/mosip/esignet/tree/master/client-management-service-impl): registry service · Handles create, update, and read of OIDC client registrations. · `client-management-service-impl`
- [Key binding](https://github.com/mosip/esignet/tree/master/binding-service-impl): binding service · Maintains public-key registry and validates binding-related state. · `binding-service-impl`
- [Consent service](https://github.com/mosip/esignet/tree/master/consent-service-impl): consent service · Persists consent records and consent history. · `consent-service-impl`

### Shared libs

Common protocol models, SPIs, and integration contracts

- [Core lib](https://github.com/mosip/esignet/tree/master/esignet-core): shared library · Shared DTOs, SPI interfaces, validation, security, cache, audit, and protocol utilities. · `esignet-core`
- [Integration API](https://github.com/mosip/esignet/tree/master/esignet-integration-api): spi contracts · Plugin-facing DTOs, exceptions, SPI interfaces, and helper contracts for external identity integrations. · `esignet-integration-api`

### Frontend

Browser UI deployed alongside the backend

- [OIDC UI](https://github.com/mosip/esignet/tree/master/oidc-ui): react app · Separate browser application for login, consent, signup, OTP, biometrics, and auth screens. · `oidc-ui`

### Platform

Database, cache, messaging, identity, and ingress dependencies

- [PostgreSQL](https://github.com/mosip/esignet/tree/master/db_scripts/mosip_esignet): database · Persistent store for clients, consents, key registry, policy, and operational metadata. · `db_scripts/mosip_esignet`
- [Redis](https://github.com/mosip/esignet/tree/master/deploy/redis): cache · Short-lived state and transaction/session caching. · `deploy/redis`
- [Kafka](https://github.com/mosip/esignet/tree/master/deploy/kafka): messaging · Asynchronous/event-driven support for queued actions and helpers. · `deploy/kafka`
- [Keycloak](https://github.com/mosip/esignet/tree/master/deploy/keycloak): identity infra · Platform identity/authentication dependency used in deployment topology. · `deploy/keycloak`
- [Gateway](https://github.com/mosip/esignet/tree/master/deploy/istio-gateway): ingress · Ingress and routing layer for public and internal traffic. · `deploy/istio-gateway`
- [SoftHSM](https://github.com/mosip/esignet/tree/master/deploy/softhsm): crypto HSM · Deployment-time cryptographic key storage and signing support. · `deploy/softhsm`

### Ops & quality

Deployment, test, and automation assets

- [Helm deploy](https://github.com/mosip/esignet/tree/master/helm/esignet): deployment charts · Kubernetes packaging for backend, UI, and supporting platform services. · `helm/esignet`
- [DB scripts](https://github.com/mosip/esignet/tree/master/db_scripts/mosip_esignet): schema ops · SQL, seed data, and upgrade scripts for the mosip_esignet schema. · `db_scripts/mosip_esignet`
- [DB upgrades](https://github.com/mosip/esignet/tree/master/db_upgrade_script/mosip_esignet/sql): migration ops · Versioned upgrade and rollback scripts for schema evolution. · `db_upgrade_script/mosip_esignet/sql`
- [API tests](https://github.com/mosip/esignet/tree/master/api-test): automation · Java/TestNG scenario coverage for OIDC, linked auth, DPoP, PAR, consent, and partner flows. · `api-test`
- [Perf tests](https://github.com/mosip/esignet/tree/master/performance-test): load testing · JMeter scripts and datasets for performance validation. · `performance-test`
- [Postman](https://github.com/mosip/esignet/tree/master/postman-collection): api exploration · Manual API collection and environment assets. · `postman-collection`

## Connections

- eSignet service → OIDC impl: delegates · Controllers hand protocol execution to the OIDC orchestration layer.
- eSignet service → Client mgmt: delegates · Client management endpoints are backed by the client registry service.
- eSignet service → Key binding: delegates · Binding-related endpoints flow into the key binding subsystem.
- eSignet service → Consent service: delegates · Consent endpoints read and write consent state through the consent service.
- eSignet service → Core lib: uses · Runtime wiring, DTOs, validators, and SPIs are shared from the core library.
- eSignet service → Integration API: uses · External authenticator and key-binder contracts come from the integration API.
- OIDC impl → Core lib: implements · OIDC implementation classes realize shared service interfaces and reuse protocol models.
- OIDC impl → Integration API: calls plugins · Authentication, captcha, and binding steps can be satisfied by external plugin implementations.
- OIDC impl → Redis: caches · Short-lived authorization and transaction state is cached externally.
- OIDC impl → Kafka: publishes · Helper utilities indicate queued or event-driven actions around link and auth flows.
- Client mgmt → PostgreSQL: persists · Client registrations are stored in the shared database schema.
- Key binding → PostgreSQL: persists · Public key registry and related binding metadata are stored in the database.
- Consent service → PostgreSQL: persists · Consent records and history are stored in the database.
- OIDC UI → eSignet service: calls HTTP · The separate browser UI exchanges auth, consent, and account-flow requests with the backend.
- Helm deploy → eSignet service: deploys · Helm charts package the backend runtime for Kubernetes.
- Helm deploy → OIDC UI: deploys · Helm charts package the React UI alongside the backend.
- Helm deploy → PostgreSQL: provisions · Cluster deployment includes the PostgreSQL dependency.
- Helm deploy → Redis: provisions · Cluster deployment includes Redis for shared state.
- Helm deploy → Kafka: provisions · Cluster deployment includes Kafka for asynchronous support.
- Helm deploy → Keycloak: provisions · Cluster deployment includes Keycloak for identity infrastructure.
- Helm deploy → Gateway: routes through · Ingress and gateway setup is part of the cluster topology.
- Helm deploy → SoftHSM: provisions · Deployment expects SoftHSM for cryptographic operations.
- DB scripts → PostgreSQL: defines schema · Initial DDL, DML, and role scripts shape the mosip_esignet database.
- DB upgrades → PostgreSQL: migrates · Versioned upgrade scripts evolve the same database schema.
- API tests → eSignet service: validates · Scenario automation exercises the backend flows end to end.
- Perf tests → eSignet service: loads · JMeter scripts target the backend runtime under load.
- Postman → eSignet service: explores · Collection assets support manual API inspection against the backend.
