# e-gov/tara-login architecture

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

- Interactive diagram: https://gitdiagram.com/e-gov/tara-login
- Repository: https://github.com/e-gov/tara-login

## Overview

TARA Login is a web application implementing OIDC login and consent flows alongside Estonian ID-card, Mobile-ID, Smart-ID, and eIDAS authentication. A typical user flow begins with an OIDC login request, proceeds through an enabled authentication method, and uses persisted session state to track progress; consent is handled as a separate OIDC stage. The tree and README establish the major capabilities, but sampled source limits verification of most controller-to-service wiring, so those links are omitted. Smart-ID and ID-card service responsibilities are supported by the supplied source excerpts and index.

Main entry points: [`src/main/java/ee/ria/taraauthserver/session/TaraSession.java`](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/session/TaraSession.java) (Authentication session), [`src/main/java/ee/ria/taraauthserver/TaraAuthServerApplication.java`](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/TaraAuthServerApplication.java) (TARA web app), [`src/main/java/ee/ria/taraauthserver/authentication/AuthInitController.java`](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/AuthInitController.java) (Login request), [`src/main/java/ee/ria/taraauthserver/authentication/HydraService.java`](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/HydraService.java) (Hydra integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_oidc["OIDC login and consent"]
  node_tara["TARA web app"]
  node_login["Login request"]
  node_hydra["Hydra integration<br/>[HydraService.java]"]
  node_consent["Consent flow"]
end

subgraph group_auth["Authentication methods"]
  node_idcard["ID-card auth"]
  node_mobile["Mobile-ID auth"]
  node_sidnotify["Smart-ID notify"]
  node_sidqr["Smart-ID QR"]
  node_sidweb["Smart-ID Web2App"]
  node_eidas["eIDAS auth"]
end

subgraph group_state["Session state"]
  node_session[("Authentication session<br/>[TaraSession.java]")]
  node_sessionutils["Session access<br/>[SessionUtils.java]"]
  node_ignite[("Ignite persistence")]
end

subgraph group_support["Identity and operations"]
  node_legal["Legal person"]
  node_registry["Business registry"]
  node_alerts["Alerts scheduler"]
end

node_user(("User"))

node_user -->|"uses"| node_tara
node_tara -.->|"serves login"| node_login
node_login -.->|"handles OIDC"| node_hydra
node_tara -.->|"serves consent"| node_consent
node_hydra -->|"uses session"| node_session
node_idcard -->|"reads and updates"| node_session
node_mobile -->|"uses session"| node_session
node_sidnotify -->|"uses session"| node_session
node_sidqr -->|"updates session"| node_session
node_sidweb -->|"updates session"| node_session
node_sessionutils -->|"accesses state"| node_session
node_tara -->|"persists sessions"| node_ignite
node_legal -.->|"queries registry"| node_registry

click node_tara "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/TaraAuthServerApplication.java"
click node_login "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/AuthInitController.java"
click node_hydra "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/HydraService.java"
click node_consent "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/consent/AuthConsentController.java"
click node_idcard "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/idcard/IdCardLoginService.java"
click node_mobile "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/mobileid/AuthMidService.java"
click node_sidnotify "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/smartid/notificationbased/AuthSidNotificationBasedService.java"
click node_sidqr "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/smartid/qrcode/AuthSidQrCodeService.java"
click node_sidweb "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/smartid/web2app/AuthSidWeb2AppService.java"
click node_eidas "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/eidas/EidasController.java"
click node_session "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/session/TaraSession.java"
click node_sessionutils "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/session/SessionUtils.java"
click node_ignite "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/session/IgniteSessionRepository.java"
click node_legal "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/legalperson/LegalpersonController.java"
click node_registry "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/legalperson/xroad/BusinessRegistryService.java"
click node_alerts "https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/alerts/AlertsScheduler.java"

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_tara,node_login,node_hydra,node_consent,node_user toneBlue
class node_idcard,node_mobile,node_sidnotify,node_sidqr,node_sidweb,node_eidas toneAmber
class node_session,node_sessionutils,node_ignite toneMint
class node_legal,node_registry,node_alerts toneRose
```

## Components

### OIDC login and consent

- [TARA web app](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/TaraAuthServerApplication.java): `src/main/java/ee/ria/taraauthserver/TaraAuthServerApplication.java`
- [Login request](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/AuthInitController.java): `src/main/java/ee/ria/taraauthserver/authentication/AuthInitController.java`
- [Hydra integration](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/HydraService.java): `src/main/java/ee/ria/taraauthserver/authentication/HydraService.java`
- [Consent flow](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/consent/AuthConsentController.java): `src/main/java/ee/ria/taraauthserver/authentication/consent/AuthConsentController.java`

### Authentication methods

- [ID-card auth](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/idcard/IdCardLoginService.java): `src/main/java/ee/ria/taraauthserver/authentication/idcard/IdCardLoginService.java`
- [Mobile-ID auth](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/mobileid/AuthMidService.java): `src/main/java/ee/ria/taraauthserver/authentication/mobileid/AuthMidService.java`
- [Smart-ID notify](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/smartid/notificationbased/AuthSidNotificationBasedService.java): `src/main/java/ee/ria/taraauthserver/authentication/smartid/notificationbased/AuthSidNotificationBasedService.java`
- [Smart-ID QR](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/smartid/qrcode/AuthSidQrCodeService.java): `src/main/java/ee/ria/taraauthserver/authentication/smartid/qrcode/AuthSidQrCodeService.java`
- [Smart-ID Web2App](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/smartid/web2app/AuthSidWeb2AppService.java): `src/main/java/ee/ria/taraauthserver/authentication/smartid/web2app/AuthSidWeb2AppService.java`
- [eIDAS auth](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/eidas/EidasController.java): `src/main/java/ee/ria/taraauthserver/authentication/eidas/EidasController.java`

### Session state

- [Authentication session](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/session/TaraSession.java): `src/main/java/ee/ria/taraauthserver/session/TaraSession.java`
- [Session access](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/session/SessionUtils.java): `src/main/java/ee/ria/taraauthserver/session/SessionUtils.java`
- [Ignite persistence](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/session/IgniteSessionRepository.java): `src/main/java/ee/ria/taraauthserver/session/IgniteSessionRepository.java`

### Identity and operations

- [Legal person](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/legalperson/LegalpersonController.java): `src/main/java/ee/ria/taraauthserver/authentication/legalperson/LegalpersonController.java`
- [Business registry](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/authentication/legalperson/xroad/BusinessRegistryService.java): `src/main/java/ee/ria/taraauthserver/authentication/legalperson/xroad/BusinessRegistryService.java`
- [Alerts scheduler](https://github.com/e-gov/tara-login/blob/master/src/main/java/ee/ria/taraauthserver/alerts/AlertsScheduler.java): `src/main/java/ee/ria/taraauthserver/alerts/AlertsScheduler.java`

### Other components

- **User**

## Connections

- User → TARA web app: uses (evidence: `README.md`)
- TARA web app → Login request: serves login
- Login request → Hydra integration: handles OIDC
- TARA web app → Consent flow: serves consent
- Hydra integration → Authentication session: uses session (evidence: `src/main/java/ee/ria/taraauthserver/authentication/HydraService.java`)
- ID-card auth → Authentication session: reads and updates (evidence: `src/main/java/ee/ria/taraauthserver/authentication/idcard/IdCardLoginService.java`)
- Mobile-ID auth → Authentication session: uses session (evidence: `src/main/java/ee/ria/taraauthserver/authentication/mobileid/AuthMidService.java`)
- Smart-ID notify → Authentication session: uses session (evidence: `src/main/java/ee/ria/taraauthserver/authentication/smartid/notificationbased/AuthSidNotificationBasedService.java`)
- Smart-ID QR → Authentication session: updates session (evidence: `src/main/java/ee/ria/taraauthserver/authentication/smartid/qrcode/AuthSidQrCodeService.java`)
- Smart-ID Web2App → Authentication session: updates session (evidence: `src/main/java/ee/ria/taraauthserver/authentication/smartid/web2app/AuthSidWeb2AppService.java`)
- Session access → Authentication session: accesses state (evidence: `src/main/java/ee/ria/taraauthserver/session/SessionUtils.java`)
- TARA web app → Ignite persistence: persists sessions (evidence: `README.md`)
- Legal person → Business registry: queries registry (evidence: `src/main/java/ee/ria/taraauthserver/authentication/legalperson/LegalpersonController.java`)
