# jihedchaabane/springboot-conf-sts-authorization-server-db architecture

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

- Interactive diagram: https://gitdiagram.com/jihedchaabane/springboot-conf-sts-authorization-server-db
- Repository: https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db

## Overview

This is a Spring Boot OAuth 2.0 authorization server with JDBC-backed registered clients and a small protected API. The main workflow is a client request reaching the authorization-server security chain, which is configured to expose OAuth endpoints, use provider settings, and sign tokens with an RSA JWK source; clients are looked up through the registered-client repository. The API also exposes hello and principal-info routes. Source excerpts establish these configuration and delegation links; database initialization, deployment details, and unsampled runtime wiring are not inferred.

Main entry points: [`src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java) (Authorization Chain), [`src/main/java/com/chj/gr/controller/HelloController.java`](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/controller/HelloController.java) (Hello Endpoint), [`src/main/java/com/chj/gr/config/DefaultSecurityConfig.java`](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/DefaultSecurityConfig.java) (Default Chain), [`src/main/java/com/chj/gr/service/CustomClientService.java`](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/service/CustomClientService.java) (Client Lookup Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server Runtime"]
  node_app["Spring Boot App"]
  node_health["Health Endpoint<br/>[application.yml]"]
end

subgraph group_oauth["OAuth Security"]
  node_authchain["Authorization Chain"]
  node_defaultchain["Default Chain"]
  node_cors["CORS Policy"]
  node_provider["Provider Settings"]
  node_signing["RSA JWK Source"]
end

subgraph group_clientdata["Client Registry"]
  node_registry["JDBC Client Repository"]
  node_clientservice["Client Lookup Service"]
  node_database[("Client Database")]
  node_clientrows["Registered Client SQL"]
end

subgraph group_api["Protected API"]
  node_hello["Hello Endpoint"]
  node_userinfo["Principal Info"]
end

node_client(("OAuth Client"))
node_caller(("API Caller"))

node_client -->|"requests tokens"| node_authchain
node_authchain -->|"uses settings"| node_provider
node_authchain -->|"uses key source"| node_signing
node_authchain -->|"configures repository"| node_registry
node_authchain -->|"applies policy"| node_cors
node_defaultchain -->|"uses policy"| node_cors
node_clientservice -->|"delegates lookups"| node_registry
node_registry -.->|"queries clients"| node_database
node_caller -->|"requests hello"| node_hello
node_caller -->|"requests principal"| node_userinfo
node_client -.->|"sends bearer token"| node_hello

click node_app "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/AuthorizationServerApplication.java"
click node_authchain "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java"
click node_defaultchain "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/DefaultSecurityConfig.java"
click node_cors "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java"
click node_provider "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java"
click node_signing "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java"
click node_registry "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java"
click node_clientservice "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/service/CustomClientService.java"
click node_clientrows "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/resources/RegisteredClients.sql"
click node_hello "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/controller/HelloController.java"
click node_userinfo "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/controller/HelloController.java"
click node_health "https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/resources/application.yml"

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_app,node_health,node_client toneBlue
class node_authchain,node_defaultchain,node_cors,node_provider,node_signing toneAmber
class node_registry,node_clientservice,node_database,node_clientrows,node_caller toneMint
class node_hello,node_userinfo toneRose
```

## Components

### Server Runtime

- [Spring Boot App](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/AuthorizationServerApplication.java): `src/main/java/com/chj/gr/AuthorizationServerApplication.java`
- [Health Endpoint](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/resources/application.yml): `src/main/resources/application.yml`

### OAuth Security

- [Authorization Chain](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java): `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`
- [Default Chain](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/DefaultSecurityConfig.java): `src/main/java/com/chj/gr/config/DefaultSecurityConfig.java`
- [CORS Policy](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java): `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`
- [Provider Settings](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java): `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`
- [RSA JWK Source](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java): `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`

### Client Registry

- [JDBC Client Repository](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/config/AuthorizationServerConfig.java): `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`
- [Client Lookup Service](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/service/CustomClientService.java): `src/main/java/com/chj/gr/service/CustomClientService.java`
- **Client Database**
- [Registered Client SQL](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/resources/RegisteredClients.sql): `src/main/resources/RegisteredClients.sql`

### Protected API

- [Hello Endpoint](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/controller/HelloController.java): `src/main/java/com/chj/gr/controller/HelloController.java`
- [Principal Info](https://github.com/jihedchaabane/springboot-conf-sts-authorization-server-db/blob/main/src/main/java/com/chj/gr/controller/HelloController.java): `src/main/java/com/chj/gr/controller/HelloController.java`

### Other components

- **OAuth Client**
- **API Caller**

## Connections

- OAuth Client → Authorization Chain: requests tokens (evidence: `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`)
- Authorization Chain → Provider Settings: uses settings (evidence: `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`)
- Authorization Chain → RSA JWK Source: uses key source (evidence: `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`)
- Authorization Chain → JDBC Client Repository: configures repository (evidence: `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`)
- Authorization Chain → CORS Policy: applies policy (evidence: `src/main/java/com/chj/gr/config/AuthorizationServerConfig.java`)
- Default Chain → CORS Policy: uses policy (evidence: `src/main/java/com/chj/gr/config/DefaultSecurityConfig.java`)
- Client Lookup Service → JDBC Client Repository: delegates lookups (evidence: `src/main/java/com/chj/gr/service/CustomClientService.java`)
- JDBC Client Repository → Client Database: queries clients
- API Caller → Hello Endpoint: requests hello (evidence: `src/main/java/com/chj/gr/controller/HelloController.java`)
- API Caller → Principal Info: requests principal (evidence: `src/main/java/com/chj/gr/controller/HelloController.java`)
- OAuth Client → Hello Endpoint: sends bearer token
