Skip to content

Commit a5a3afa

Browse files
committed
docs: apply comprehensive review findings across project documentation
- DEVPLAN.md: resequence priorities with v1.0 blocker annotations (1.14, 1.18, 1.25); add Feature 1.26 (basic rate limiting); promote MFA to Feature 2.8; update Google Provider status; fix Blazor naming conflict; add CIBA (5.11), SD-JWT + OID4VC (expanded 5.10); loosen Phase 3 prerequisites; add login_hint auto-redirect note; reconsider CIBA - Technical_Plan.md: remove stale week estimates; mark RSA/ECDSA providers as implemented; add JsonWebTokenHandler note; mark IGrantTypeHandler as implemented; update Open Questions - Project_Overview.md: reposition SMS OTP as fallback; clarify SQLite via EFCore; mark SAML as excluded from roadmap; update HS256 dev narrative - CONTRIBUTING.md: add contribution areas, PR process, commit conventions
1 parent 3806625 commit a5a3afa

4 files changed

Lines changed: 157 additions & 49 deletions

File tree

CONTRIBUTING.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
# Contributing
22

3-
Thanks for your interest in contributing to CoreIdent.
3+
Thanks for your interest in contributing to CoreIdent!
4+
5+
## Key areas for contribution
6+
7+
- **External providers** — Microsoft, GitHub, Apple (see `src/CoreIdent.Providers.Google/` for the pattern)
8+
- **Storage adapters** — MongoDB, Redis, etc. (implement `IUserStore`, `IClientStore`, etc.)
9+
- **UI themes** — Razor/Blazor components for login, consent, account management
10+
- **Documentation** — Guides, examples, translations
11+
- **Bug fixes** — Check [GitHub Issues](https://github.com/stimpy77/CoreIdent/issues)
12+
13+
## Submitting changes
14+
15+
1. Fork the repository and create a feature branch from `main`
16+
2. Follow the coding standards in `CLAUDE.md` (they apply to humans too)
17+
3. Write tests before or alongside your code — all PRs must include tests
18+
4. Use conventional commit prefixes: `feat:`, `fix:`, `test:`, `docs:`, `chore:`, `refactor:`
19+
5. One feature per commit — keep commits atomic
20+
6. Ensure `dotnet test CoreIdent.sln` passes before submitting
21+
7. Open a pull request against `main` with a clear description
422

523
## Development environments
624

docs/DEVPLAN.md

Lines changed: 116 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ This document provides a detailed breakdown of tasks, components, test cases, an
2424
>
2525
> Do **not** move partially complete features. If even one checkbox is unchecked or there are known concerns, the feature stays here in full detail until resolved.
2626
27-
**Key priorities:**
28-
- Phase 0 (Foundation) is now first priority — asymmetric keys, revocation, introspection
29-
- Passwordless authentication is Phase 1
30-
- Test infrastructure overhaul is a dedicated effort
31-
- Removed: Web3, LNURL, AI integrations
32-
- Added: DPoP, RAR, SPIFFE/SPIRE (later phases)
27+
**Key priorities (updated 2026-03-15 — review-driven resequencing):**
28+
- Phase 0 ✅ and most of Phase 1 ✅ are complete
29+
- **Immediate v1.0 blockers:** Account Recovery (1.18), Basic Rate Limiting (1.26), Refresh Token Atomicity (1.25), OAuth 2.1 Declaration (1.14), `grant_types_supported` discovery fix, README.md
30+
- **Next priority:** Social login providers (2.2–2.4), CORS (1.20), Auth Session (1.17), OIDC Params (1.16), MFA (promoted from 5.1 to 2.8)
31+
- **Deferred:** WPF/WinForms client (1.5.4), Console client (1.5.5), Blazor WASM client (1.5.6 — merge into BlazorWeb), JAR (3.9), SPIFFE/SPIRE (5.5)
32+
- Removed: Web3, LNURL, AI SDK integrations
3333
3434
> **Note:** References to "creating" components mean implementing the feature within the current architecture.
3535
@@ -84,13 +84,17 @@ This document provides a detailed breakdown of tasks, components, test cases, an
8484
| RFC 8414 OAuth AS Metadata | 1 | 1.21 | 🔲 Planned |
8585
| ROPC Extraction to Legacy Package | 1 | 1.22 | ✅ Complete |
8686
| Blazor Unification (Rename) | 1 | 1.23 | 🔲 Planned |
87+
| AuthorizationCode Delivery for Passwordless | 1 | 1.24 | 🔲 Planned |
88+
| Refresh Token Rotation Atomicity | 1 | 1.25 | 🔲 Planned (v1.0 blocker — correctness) |
89+
| Basic Rate Limiting (IP-based) | 1 | 1.26 | 🔲 Planned (v1.0 blocker — security) |
8790
| Provider Abstraction Layer | 2 | 2.1 | ✅ Complete |
88-
| Google Provider | 2 | 2.2 | 🔲 Planned |
91+
| Google Provider | 2 | 2.2 | 🔶 In Progress (code exists, DEVPLAN tasks remain) |
8992
| Microsoft Provider | 2 | 2.3 | 🔲 Planned |
9093
| GitHub Provider | 2 | 2.4 | 🔲 Planned |
9194
| Apple Provider | 2 | 2.5 | 🔲 Planned |
9295
| JS/TS Client Documentation | 2 | 2.6 | 🔲 Planned |
9396
| Rate Limiting (IRateLimiter) | 2 | 2.7 | 🔲 Planned |
97+
| MFA Framework (TOTP + Backup Codes) | 2 | 2.8 | 🔲 Planned (promoted from Phase 5) |
9498
| Key Rotation | 3 | 3.1 | 🔲 Planned |
9599
| Session Management & OIDC Logout (incl. Back-Channel) | 3 | 3.2 | 🔲 Planned |
96100
| Dynamic Client Registration | 3 | 3.3 | 🔲 Planned |
@@ -104,10 +108,13 @@ This document provides a detailed breakdown of tasks, components, test cases, an
104108
| Admin API | 4 | 4.3 | 🔲 Planned |
105109
| Domain Verification | 4 | 4.5 | 🔲 Planned |
106110
| Connected Apps (Post-Auth Account Linking) | 4 | 4.6 | 🔲 Planned |
107-
| MFA Framework | 5 | 5.1 | 🔲 Planned |
111+
| MFA Framework (TOTP + Backup Codes) | 2 | 2.8 | 🔲 Planned (promoted from 5.1) |
108112
| SCIM | 5 | 5.4 | 🔲 Planned |
109113
| SPIFFE/SPIRE | 5 | 5.5 | 🔲 Planned |
110-
| Verifiable Credentials | 5 | 5.10 | 🔲 Planned |
114+
| CIBA (Client Initiated Backchannel Auth) | 5 | 5.6 | 🔲 Planned (reconsidered — financial/healthcare/IoT) |
115+
| SD-JWT (Selective Disclosure) | 5 | 5.11 | 🔲 Planned (EU Digital Identity Wallet) |
116+
| OID4VCI / OID4VP Protocols | 5 | 5.12 | 🔲 Planned (VC issuance/presentation) |
117+
| Verifiable Credentials + SD-JWT | 5 | 5.10 | 🔲 Planned (expanded scope) |
111118
112119
---
113120
@@ -352,7 +359,9 @@ This document provides a detailed breakdown of tasks, components, test cases, an
352359
353360
---
354361
355-
### Feature 1.14: OAuth 2.1 Compliance Declaration
362+
### Feature 1.14: OAuth 2.1 Compliance Declaration (v1.0 Blocker)
363+
364+
> **Review finding (2026-03-15):** Marketing and trust signal. Also add RFC 9700 (OAuth 2.0 Security BCP) compliance claim alongside OAuth 2.1 declaration.
356365
357366
- [ ] (L2) Verify exact redirect URI matching in `AuthorizationEndpointExtensions.cs`
358367
- [ ] (L1) Verify no implicit grant response types accepted
@@ -409,7 +418,9 @@ This document provides a detailed breakdown of tasks, components, test cases, an
409418
410419
---
411420
412-
### Feature 1.18: Account Recovery / Password Reset
421+
### Feature 1.18: Account Recovery / Password Reset (v1.0 Blocker)
422+
423+
> **Review finding (2026-03-15):** No production app can ship without account recovery. This is the most basic flow every app needs.
413424
414425
* **Component:** Recovery Endpoints
415426
- [ ] (L2) Create `POST /auth/account/recover` — accept email, send reset link via IEmailSender
@@ -492,7 +503,9 @@ This document provides a detailed breakdown of tasks, components, test cases, an
492503
493504
---
494505
495-
### Feature 1.25: Refresh Token Rotation Atomicity
506+
### Feature 1.25: Refresh Token Rotation Atomicity (v1.0 Blocker)
507+
508+
> **Review finding (2026-03-15):** If rotation fails mid-operation, it can lead to token theft going undetected or legitimate users being locked out. This is a correctness bug, not a feature.
496509
497510
* **Component:** Atomic Token Exchange
498511
- [ ] (L2) Add compensating rollback to `IRefreshTokenStore` — if new token storage fails after old token consumption, restore the old token
@@ -504,13 +517,27 @@ This document provides a detailed breakdown of tasks, components, test cases, an
504517
505518
---
506519
520+
### Feature 1.26: Basic Rate Limiting (v1.0 Blocker)
521+
522+
> **Review finding (2026-03-15):** Login, registration, and token endpoints have no rate limiting. This is a production security gap. This feature provides a basic IP-based rate limiter as a v1.0 prerequisite. The full `IRateLimiter` abstraction (Feature 2.7) expands on this later.
523+
524+
* **Component:** IP-Based Rate Limiting Middleware
525+
- [ ] (L2) Create `AddCoreIdentBasicRateLimiting()` extension using ASP.NET Core `Microsoft.AspNetCore.RateLimiting`
526+
- [ ] (L2) Apply fixed-window IP-based rate limits to: `/auth/login`, `/auth/register`, `/auth/token`
527+
- [ ] (L1) Configurable limits via `CoreIdentRateLimitOptions` (requests per window, window duration)
528+
- [ ] (L1) Return `429 Too Many Requests` with `Retry-After` header
529+
* **Test Case:**
530+
- [ ] (L2) Exceeding limit returns 429 on login/register/token endpoints
531+
532+
---
533+
507534
## Phase 1.5: Client Libraries
508535
509536
**Goal:** Enable any .NET application to authenticate against CoreIdent (or any OAuth/OIDC server) with minimal code.
510537
511538
**Estimated Duration:** 3-4 weeks
512539
513-
**Prerequisites:** Phase 1 complete (server-side passwordless)
540+
**Prerequisites:** Phase 1 core features complete (0.x–1.13). Features 1.14–1.26 may be completed in parallel.
514541
515542
---
516543
@@ -598,6 +625,10 @@ This document provides a detailed breakdown of tasks, components, test cases, an
598625
599626
**Prerequisites:** Phase 1.5 complete
600627
628+
> **Review finding (2026-03-15):** Social login (Google/Microsoft/GitHub) is table stakes — the 80% expects these to "just work." Prioritize 2.2–2.4 before Phase 3 hardening.
629+
>
630+
> **Cross-cutting feature:** `login_hint` → provider auto-redirect. When the authorize endpoint receives `login_hint=user@example.com` and the email domain matches a configured external provider, auto-redirect to that provider. This is a common B2B UX pattern (WorkOS, Auth0). Implement alongside or after providers ship.
631+
601632
---
602633
603634
### Feature 2.1: Provider Abstraction Layer — COMPLETE
@@ -608,16 +639,18 @@ This document provides a detailed breakdown of tasks, components, test cases, an
608639
609640
---
610641
611-
### Feature 2.2: Google Provider
642+
### Feature 2.2: Google Provider (In Progress)
643+
644+
> **Note:** `CoreIdent.Providers.Google` project and `GoogleAuthProvider` class already exist with ID token validation and claim extraction. Remaining tasks below track completion of the full feature.
612645
613646
* **Component:** `CoreIdent.Providers.Google` Package
614-
- [ ] (L1) Create new project
615-
- [ ] (L3) Implement `IExternalAuthProvider` for Google
616-
- [ ] (L3) Handle OAuth flow with Google
617-
- [ ] (L1) Map Google profile to `ExternalUserProfile`
647+
- [x] (L1) Create new project
648+
- [x] (L3) Implement `IExternalAuthProvider` for Google
649+
- [~] (L3) Handle OAuth flow with Google (code exchange exists; full redirect flow integration TBD)
650+
- [x] (L1) Map Google profile to `ExternalUserProfile`
618651
* **Component:** Configuration
619-
- [ ] (L1) Create `GoogleProviderOptions` (ClientId, ClientSecret, Scopes)
620-
- [ ] (L1) Add `AddGoogleProvider()` extension method
652+
- [~] (L1) Create `GoogleProviderOptions` (ClientId, ClientSecret, Scopes) — partially exists via `ExternalProviderOptions<GoogleAuthProvider>`
653+
- [x] (L1) Add `AddGoogleProvider()` extension method
621654
* **Test Case (Integration):**
622655
- [ ] (L1) Configuration validation works
623656
- [ ] (Full flow requires manual testing or mock)
@@ -692,13 +725,37 @@ This document provides a detailed breakdown of tasks, components, test cases, an
692725
693726
---
694727
728+
### Feature 2.8: MFA Framework — TOTP + Backup Codes (Promoted from Phase 5)
729+
730+
> **Review finding (2026-03-15):** MFA is table stakes for any production auth system in 2026. Required by SOC 2, PCI-DSS, HIPAA. Promoted from Phase 5.1 to Phase 2. More important than PAR, RAR, or JAR for the 80% market.
731+
732+
* **Component:** TOTP Support
733+
- [ ] (L2) Implement TOTP generation and validation (RFC 6238)
734+
- [ ] (L2) QR code provisioning URI generation
735+
- [ ] (L2) Store TOTP secret per user (encrypted)
736+
- [ ] (L2) MFA enrollment endpoints: `POST /auth/mfa/totp/setup`, `POST /auth/mfa/totp/verify`
737+
* **Component:** Backup Codes
738+
- [ ] (L2) Generate set of one-time backup codes at MFA enrollment
739+
- [ ] (L2) Hash and store backup codes
740+
- [ ] (L2) Recovery via backup code endpoint: `POST /auth/mfa/backup/verify`
741+
* **Component:** MFA Enforcement
742+
- [ ] (L2) Per-user MFA status tracking
743+
- [ ] (L2) MFA challenge step in login flow (after primary auth, before token issuance)
744+
- [ ] (L2) Configuration: require MFA for all users, or opt-in per user
745+
* **Test Case:**
746+
- [ ] (L3) Full TOTP enrollment + login flow
747+
- [ ] (L2) Backup code recovery works and is single-use
748+
- [ ] (L2) MFA enforcement blocks login without second factor
749+
750+
---
751+
695752
## Phase 3: OAuth/OIDC Server Hardening
696753
697754
**Goal:** Production-grade OAuth 2.0 / OIDC server capabilities.
698755
699756
**Estimated Duration:** 4-5 weeks
700757
701-
**Prerequisites:** Phase 2 complete
758+
**Prerequisites:** Phase 1 core + Phase 2 providers. Features like Key Rotation (3.1) and Session Management (3.2) do not depend on external providers and may start earlier.
702759
703760
---
704761
@@ -1113,11 +1170,9 @@ This document provides a detailed breakdown of tasks, components, test cases, an
11131170
11141171
---
11151172
1116-
### Feature 5.1: MFA Framework
1173+
### Feature 5.1: MFA Framework — PROMOTED TO 2.8
11171174
1118-
* **Component:** TOTP Support (L2)
1119-
* **Component:** Backup Codes (L2)
1120-
* **Component:** MFA Enforcement Policies (L2)
1175+
> **Moved to Feature 2.8 (Phase 2).** MFA is table stakes for production auth systems and compliance (SOC 2, PCI-DSS, HIPAA). See Feature 2.8 for full checklist.
11211176
11221177
---
11231178
@@ -1248,9 +1303,11 @@ This document provides a detailed breakdown of tasks, components, test cases, an
12481303
12491304
---
12501305
1251-
### Feature 5.9: Blazor Server Integration
1306+
### Feature 5.9: Blazor Web App Integration (Unified)
1307+
1308+
> **Review finding (2026-03-15):** Renamed from `BlazorServer` to `BlazorWeb` per Feature 1.23. .NET 10's unified Blazor Web App model makes separate Server/WASM packages unnecessary. This feature and Feature 1.5.6 (Blazor WASM) should be merged into a single `CoreIdent.Client.BlazorWeb` package targeting all render modes (InteractiveServer, InteractiveWebAssembly, InteractiveAuto).
12521309
1253-
* **Component:** `CoreIdent.Client.BlazorServer` Package
1310+
* **Component:** `CoreIdent.Client.BlazorWeb` Package
12541311
- [ ] (L3) Circuit-aware token storage
12551312
- [ ] (L3) Automatic token refresh in circuit
12561313
- [ ] (L3) Handle circuit disconnection gracefully
@@ -1268,10 +1325,40 @@ This document provides a detailed breakdown of tasks, components, test cases, an
12681325
12691326
---
12701327
1271-
### Feature 5.10: Verifiable Credentials
1328+
### Feature 5.10: Verifiable Credentials + SD-JWT (Expanded Scope)
1329+
1330+
> **Review finding (2026-03-15):** W3C VC data model alone isn't useful without issuance/presentation protocols. Expanded to include OID4VC family and SD-JWT for EU Digital Identity Wallet compatibility.
12721331
12731332
* **Component:** W3C VC issuance (L3)
12741333
* **Component:** VC verification (L3)
1334+
* **Component:** SD-JWT (Selective Disclosure JWT)
1335+
- [ ] (L3) SD-JWT token creation and verification
1336+
- [ ] (L2) Integration with VC issuance for selective disclosure
1337+
- [ ] (L1) Documentation: SD-JWT use cases (EU Digital Identity Wallet, mDL)
1338+
* **Component:** OID4VCI (OpenID for Verifiable Credential Issuance)
1339+
- [ ] (L3) Credential offer and issuance endpoints
1340+
- [ ] (L3) Credential format negotiation
1341+
* **Component:** OID4VP (OpenID for Verifiable Presentations)
1342+
- [ ] (L3) Presentation request and response handling
1343+
- [ ] (L3) Verifier endpoint integration
1344+
1345+
---
1346+
1347+
### Feature 5.11: CIBA — Client Initiated Backchannel Authentication (Reconsidered)
1348+
1349+
> **Review finding (2026-03-15):** Previously removed as "CIBA for AI Actions." Reconsidered for legitimate non-AI use cases: financial services (PSD2 SCA), healthcare consent flows, and IoT device authorization where the device can't render a browser.
1350+
1351+
* **Component:** Backchannel Authentication Endpoint
1352+
- [ ] (L3) `POST /auth/bc-authorize` — accept `login_hint`, `binding_message`, `scope`
1353+
- [ ] (L3) Push and poll notification modes
1354+
- [ ] (L2) User consent via out-of-band channel (push notification, SMS)
1355+
* **Component:** Token Endpoint Extension
1356+
- [ ] (L3) `grant_type=urn:openid:params:grant-type:ciba` support
1357+
- [ ] (L3) Polling with `slow_down` and `authorization_pending` responses
1358+
* **Test Case:**
1359+
- [ ] (L3) Full CIBA flow with polling mode
1360+
* **Documentation:**
1361+
- [ ] (L1) CIBA use case guide (financial, healthcare, IoT)
12751362
12761363
---
12771364
@@ -1315,7 +1402,7 @@ The following items are tracked here for completeness and cross-referencing:
13151402
| Web3 Wallet Login | Niche adoption |
13161403
| LNURL-auth | Very niche |
13171404
| AI Framework SDK Integrations | Premature (note: MCP-compatible authorization in Feature 3.13 is a distinct, protocol-level OAuth 2.1 extension — not an AI SDK integration) |
1318-
| CIBA for AI Actions | Specialized (note: MCP Auth in Feature 3.13 addresses AI agent authorization via standard OAuth flows, not the niche CIBA backchannel protocol) |
1405+
| ~~CIBA for AI Actions~~ | **Reconsidered (2026-03-15).** Removed the AI framing but restored CIBA for legitimate non-AI use cases (PSD2 SCA, healthcare, IoT). See Feature 5.11. |
13191406
| Token Vault / Secrets Management | Out of scope |
13201407
| Feature Flags / Rollout Control | Out of scope; not an identity concern. Use dedicated tools (LaunchDarkly, Unleash, Flagsmith, etc.) |
13211408
| **Resource Owner Password Credentials (ROPC)** | Deprecated in OAuth 2.1 (RFC 9725). Extracted to `CoreIdent.Legacy.PasswordGrant` for migration support. |

docs/Project_Overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ CoreIdent occupies a unique position in the .NET identity landscape. Here's how
5252
|-----------|-----------|----------------------|
5353
| **License** | MIT — free forever, no production restrictions | RPL — requires paid license for production use |
5454
| **Architecture** | Minimal API native, .NET 10 only | MVC-based, supports older .NET versions |
55-
| **Auth model** | Passwordless-first (magic links, passkeys, SMS OTP) | Password-first, passwordless as add-on |
55+
| **Auth model** | Passwordless-first (passkeys, magic links); SMS OTP as fallback | Password-first, passwordless as add-on |
5656
| **Developer tooling** | CLI tool, `dotnet new` templates, Aspire integration, client libraries | Limited tooling, more manual setup |
5757
| **Language support** | First-class F# templates and compatibility | C# only |
5858
| **OpenID certification** | Not yet (planned) | OpenID Foundation certified |
@@ -106,12 +106,12 @@ CoreIdent is built as a **composable ecosystem of packages**, not a monolithic f
106106
│ STORAGE │ │ PROVIDERS │ │ FEATURES │ │ CLIENTS │
107107
├───────────────┤ ├─────────────────┤ ├─────────────────┤ ├─────────────────┤
108108
│ .EFCore │ │ .Google │ │ .Passwordless │ │ .Client │
109-
│ .Sqlite │ │ .Microsoft │ │ .Passkeys │ │ .Client.Maui │
109+
│ .Sqlite │ │ .Microsoft │ │ .Passkeys │ │ .Client.Maui │
110110
│ .MongoDB* │ │ .GitHub │ │ .MFA │ │ .Client.Wpf │
111111
│ .Redis* │ │ .Apple │ │ .UI.Web │ │ .Client.Console │
112-
│ .Adapters │ │ .SAML* │ │ .AdminApi │ │ .Client.Blazor │
112+
│ .Adapters │ │ .SAML* │ │ .AdminApi │ │ .Client.Blazor │
113113
└───────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘
114-
* = community/future
114+
* = community/future | † = provided via .EFCore package, not separate | ‡ = excluded from core roadmap; community contribution only
115115
```
116116

117117
**Key modularity principles:**
@@ -516,7 +516,7 @@ Implementation status is tracked in `docs/DEVPLAN.md`. This section describes th
516516
- Update JWKS endpoint for asymmetric keys
517517
- Token Revocation endpoint (RFC 7009)
518518
- Token Introspection endpoint (RFC 7662)
519-
- Remove/deprecate HS256-only code paths (keep as opt-in for dev/testing)
519+
- Remove/deprecate HS256-only code paths (ephemeral RSA keys are auto-generated for dev; HS256 retained only for edge-case compatibility)
520520

521521
> **Note on JWT revocation:** Revoking a JWT access token only works for resource servers that perform an online check (e.g., introspection or a shared revocation store). Default guidance is short-lived access tokens + refresh token rotation/revocation. See Phase 3 for “revocable access” in controlled distributed systems.
522522

0 commit comments

Comments
 (0)