How etda/thaid-csharp-rp works
ThaIDAuthenExample is an ASP.NET MVC sample for ThaID OpenID Connect login; ThaIDAuthenAPIExample is a companion resource-server-style API demonstrating token inspection and revocation. The web flow starts at login, obtains tokens on callback, stores them in session, and supports refresh and ID-token validation. The API accepts bearer tokens and delegates inspection or revocation to ThaID. Relationships are based on the README and shown source excerpts; unsampled views and configuration are represented only where their paths are present in the tree.
Main entry points: HomeController.cs Authentication controller · Services/AuthenticationService.cs OIDC service · Services/AuthenticationService.cs Token operations · Program.cs Token session
Components 18
Web authentication
- MVC routes
ThaIDAuthenExample/Program.cs - Authentication controller
ThaIDAuthenExample/Controllers/HomeController.cs - Authentication views
ThaIDAuthenExample/Views/Home - Token session
ThaIDAuthenExample/Program.cs
Identity services
- OIDC service
ThaIDAuthenExample/Services/AuthenticationService.cs - ThaID identity provider
- ThaID JWKS
Resource API
- API routes
ThaIDAuthenAPIExample/Program.cs - Token inspection endpoint
ThaIDAuthenAPIExample/Controllers/TokenInspectController.cs - Token revocation endpoint
ThaIDAuthenAPIExample/Controllers/TokenRevokeController.cs - Token operations
ThaIDAuthenAPIExample/Services/AuthenticationService.cs - ThaID resource APIs
Token and response models
- OIDC token model
ThaIDAuthenExample/Models/TokenModel.cs - Error response model
ThaIDAuthenExample/Models/ErrorViewModel.cs - Inspection response
ThaIDAuthenAPIExample/Models/TokenModel.cs - Revocation response
ThaIDAuthenAPIExample/Models/TokenModel.cs
Other components
- Browser user
- API caller
Connections 23
- Browser user → Authentication controller: opens login
README.md - Authentication controller → OIDC service: creates provider
ThaIDAuthenExample/Controllers/HomeController.cs - Authentication controller → OIDC service: requests tokens
ThaIDAuthenExample/Controllers/HomeController.cs - OIDC service → ThaID identity provider: OIDC exchange
ThaIDAuthenExample/Services/AuthenticationService.cs - Authentication controller → Token session: stores tokens
README.md - Authentication controller → Token session: reads tokens
ThaIDAuthenExample/Controllers/HomeController.cs - Authentication controller → OIDC service: refreshes tokens
ThaIDAuthenExample/Controllers/HomeController.cs - Authentication controller → OIDC service: validates ID token
ThaIDAuthenExample/Controllers/HomeController.cs - OIDC service → ThaID JWKS: fetches keys
ThaIDAuthenExample/Services/AuthenticationService.cs - OIDC service → OIDC token model: deserializes tokens
README.md - Authentication controller → Authentication views: renders
ThaIDAuthenExample/Controllers/HomeController.cs - Authentication controller → Error response model: creates error model
ThaIDAuthenExample/Controllers/HomeController.cs - MVC routes → OIDC service: registers service
ThaIDAuthenExample/Program.cs - MVC routes → Token session: enables session
ThaIDAuthenExample/Program.cs - API caller → Token inspection endpoint: submits bearer token
ThaIDAuthenAPIExample/Controllers/TokenInspectController.cs - API caller → Token revocation endpoint: submits bearer token
ThaIDAuthenAPIExample/Controllers/TokenRevokeController.cs - API routes → Token operations: registers service
ThaIDAuthenAPIExample/Program.cs - Token inspection endpoint → Token operations: requests inspection
ThaIDAuthenAPIExample/Controllers/TokenInspectController.cs - Token revocation endpoint → Token operations: requests revocation
ThaIDAuthenAPIExample/Controllers/TokenRevokeController.cs - Token operations → ThaID resource APIs: posts inspection
ThaIDAuthenAPIExample/Services/AuthenticationService.cs - Token operations → ThaID resource APIs: posts revocation
ThaIDAuthenAPIExample/Services/AuthenticationService.cs - Token operations → Inspection response: deserializes response
ThaIDAuthenAPIExample/Services/AuthenticationService.cs - Token operations → Revocation response: deserializes response
ThaIDAuthenAPIExample/Services/AuthenticationService.cs