# manojnewgen/aspclassicproject architecture

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

- Interactive diagram: https://gitdiagram.com/manojnewgen/aspclassicproject
- Repository: https://github.com/manojnewgen/aspclassicproject

## Overview

This repository implements an Okta SAML authentication gateway that connects a Classic ASP application to a .NET web service. The principal flow authenticates with Okta, validates and maps the SAML identity, classifies and resolves or onboards a local user, then creates a short-lived database token for the legacy application. Logout clears the bridge session and returns the user through Okta logout. The Classic ASP bridge and database-backed token exchange are evident from the tree and sampled service; wiring within unsampled ASP pages is not asserted beyond the documented bridge role.

Main entry points: [`src/OktaSamlIntegration.Web/Controllers/AuthController.cs`](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Controllers/AuthController.cs) (Auth Controller), [`db/schema.sql`](https://github.com/manojnewgen/aspclassicproject/blob/master/db/schema.sql) (Application SQL), [`src/OktaSamlIntegration.Infrastructure/Providers/OktaSamlProvider.cs`](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Providers/OktaSamlProvider.cs) (Okta SAML Provider), [`src/OktaSamlIntegration.Web/Program.cs`](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Program.cs) (Web Host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Gateway"]
  node_web_host["Web Host<br/>[Program.cs]"]
  node_auth_controller["Auth Controller<br/>[AuthController.cs]"]
  node_exception_middleware["SAML Error Middleware"]
end

subgraph group_saml["SAML Authentication"]
  node_saml_provider["Okta SAML Provider"]
  node_saml_validator["SAML Validator<br/>[SamlValidator.cs]"]
  node_signature_verifier["XML Signature Verifier"]
  node_replay_detector["Replay Detector"]
end

subgraph group_identity["Identity Services"]
  node_classification["Group Classification"]
  node_user_lookup["User Lookup"]
  node_onboarding["User Onboarding"]
end

subgraph group_legacy["Legacy Bridge"]
  node_classic_login["ASP Login<br/>[Login.asp]"]
  node_classic_callback["ASP Callback<br/>[LoginCallback.asp]"]
  node_classic_session["ASP Session Check<br/>[check_session.asp]"]
  node_classic_logout["ASP Logout<br/>[Logout.asp]"]
  node_session_service["Session Token Service"]
end

subgraph group_state["Persistent State"]
  node_sql[("Application SQL<br/>[schema.sql]")]
end

node_user(("User"))
node_okta(("Okta IdP"))

node_user -->|"opens login"| node_classic_login
node_classic_login -->|"requests gateway"| node_web_host
node_web_host -->|"routes requests"| node_auth_controller
node_auth_controller -->|"starts challenge"| node_saml_provider
node_saml_provider -->|"redirects SAML request"| node_okta
node_okta -->|"posts assertion"| node_saml_provider
node_saml_provider -->|"validates response"| node_saml_validator
node_saml_validator -->|"checks signature"| node_signature_verifier
node_saml_validator -->|"checks replay"| node_replay_detector
node_auth_controller -->|"resolves group type"| node_classification
node_classification -->|"reads group mappings"| node_sql
node_auth_controller -->|"resolves local user"| node_user_lookup
node_user_lookup -->|"reads user mappings"| node_sql
node_user_lookup -->|"onboards missing user"| node_onboarding
node_onboarding -->|"writes user records"| node_sql
node_auth_controller -->|"creates bridge token"| node_session_service
node_session_service -->|"writes session token"| node_sql
node_classic_callback -->|"redeems session token"| node_sql
node_classic_session -->|"checks session"| node_sql
node_user -->|"requests logout"| node_classic_logout
node_classic_logout -->|"requests gateway logout"| node_auth_controller
node_auth_controller -->|"destroys local session"| node_session_service
node_auth_controller -->|"redirects SLO"| node_okta
node_web_host -->|"installs middleware"| node_exception_middleware
node_exception_middleware -->|"forwards requests"| node_auth_controller

click node_classic_login "https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/Login.asp"
click node_classic_callback "https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/LoginCallback.asp"
click node_classic_session "https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/check_session.asp"
click node_classic_logout "https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/Logout.asp"
click node_web_host "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Program.cs"
click node_auth_controller "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Controllers/AuthController.cs"
click node_exception_middleware "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Middleware/SamlExceptionMiddleware.cs"
click node_saml_provider "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Providers/OktaSamlProvider.cs"
click node_saml_validator "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/SamlValidator.cs"
click node_signature_verifier "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Cryptography/XmlSignatureVerifier.cs"
click node_replay_detector "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/MemoryCacheReplayDetector.cs"
click node_classification "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/UserClassificationService.cs"
click node_user_lookup "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/DefaultUserLookupService.cs"
click node_onboarding "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/DefaultUserOnboardingService.cs"
click node_session_service "https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/DefaultSessionService.cs"
click node_sql "https://github.com/manojnewgen/aspclassicproject/blob/master/db/schema.sql"

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_web_host,node_auth_controller,node_exception_middleware,node_user toneBlue
class node_saml_provider,node_saml_validator,node_signature_verifier,node_replay_detector toneAmber
class node_classification,node_user_lookup,node_onboarding toneMint
class node_classic_login,node_classic_callback,node_classic_session,node_classic_logout,node_session_service toneRose
class node_sql,node_okta toneIndigo
```

## Components

### Web Gateway

- [Web Host](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Program.cs): `src/OktaSamlIntegration.Web/Program.cs`
- [Auth Controller](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Controllers/AuthController.cs): `src/OktaSamlIntegration.Web/Controllers/AuthController.cs`
- [SAML Error Middleware](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Web/Middleware/SamlExceptionMiddleware.cs): `src/OktaSamlIntegration.Web/Middleware/SamlExceptionMiddleware.cs`

### SAML Authentication

- [Okta SAML Provider](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Providers/OktaSamlProvider.cs): `src/OktaSamlIntegration.Infrastructure/Providers/OktaSamlProvider.cs`
- [SAML Validator](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/SamlValidator.cs): `src/OktaSamlIntegration.Infrastructure/Services/SamlValidator.cs`
- [XML Signature Verifier](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Cryptography/XmlSignatureVerifier.cs): `src/OktaSamlIntegration.Infrastructure/Cryptography/XmlSignatureVerifier.cs`
- [Replay Detector](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/MemoryCacheReplayDetector.cs): `src/OktaSamlIntegration.Infrastructure/Services/MemoryCacheReplayDetector.cs`

### Identity Services

- [Group Classification](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/UserClassificationService.cs): `src/OktaSamlIntegration.Infrastructure/Services/UserClassificationService.cs`
- [User Lookup](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/DefaultUserLookupService.cs): `src/OktaSamlIntegration.Infrastructure/Services/DefaultUserLookupService.cs`
- [User Onboarding](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/DefaultUserOnboardingService.cs): `src/OktaSamlIntegration.Infrastructure/Services/DefaultUserOnboardingService.cs`

### Legacy Bridge

- [ASP Login](https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/Login.asp): `classic-asp/Login.asp`
- [ASP Callback](https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/LoginCallback.asp): `classic-asp/LoginCallback.asp`
- [ASP Session Check](https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/check_session.asp): `classic-asp/check_session.asp`
- [ASP Logout](https://github.com/manojnewgen/aspclassicproject/blob/master/classic-asp/Logout.asp): `classic-asp/Logout.asp`
- [Session Token Service](https://github.com/manojnewgen/aspclassicproject/blob/master/src/OktaSamlIntegration.Infrastructure/Services/DefaultSessionService.cs): `src/OktaSamlIntegration.Infrastructure/Services/DefaultSessionService.cs`

### Persistent State

- [Application SQL](https://github.com/manojnewgen/aspclassicproject/blob/master/db/schema.sql): `db/schema.sql`

### Other components

- **User**
- **Okta IdP**

## Connections

- User → ASP Login: opens login
- ASP Login → Web Host: requests gateway
- Web Host → Auth Controller: routes requests
- Auth Controller → Okta SAML Provider: starts challenge
- Okta SAML Provider → Okta IdP: redirects SAML request
- Okta IdP → Okta SAML Provider: posts assertion
- Okta SAML Provider → SAML Validator: validates response
- SAML Validator → XML Signature Verifier: checks signature
- SAML Validator → Replay Detector: checks replay
- Auth Controller → Group Classification: resolves group type
- Group Classification → Application SQL: reads group mappings
- Auth Controller → User Lookup: resolves local user
- User Lookup → Application SQL: reads user mappings
- User Lookup → User Onboarding: onboards missing user
- User Onboarding → Application SQL: writes user records
- Auth Controller → Session Token Service: creates bridge token
- Session Token Service → Application SQL: writes session token
- ASP Callback → Application SQL: redeems session token
- ASP Session Check → Application SQL: checks session
- User → ASP Logout: requests logout
- ASP Logout → Auth Controller: requests gateway logout
- Auth Controller → Session Token Service: destroys local session
- Auth Controller → Okta IdP: redirects SLO
- Web Host → SAML Error Middleware: installs middleware
- SAML Error Middleware → Auth Controller: forwards requests
