You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added `client_credentials` grant type handling to `/token` endpoint.
115
118
116
119
## 6. EF Core Storage Project Details: `src\CoreIdent.Storage.EntityFrameworkCore`
117
120
@@ -129,6 +132,8 @@ This is the central library containing the core logic, interfaces, and models.
129
132
*`AuthorizationCodeCleanupService.cs`: Background service that automatically removes expired authorization codes.
130
133
*`Extensions`: Contains DI extensions.
131
134
*`CoreIdentEntityFrameworkCoreExtensions.cs`: Contains `AddCoreIdentEntityFrameworkStores` extension to register EF Core stores (Scoped) with optional token and authorization code cleanup services.
## 6.5 Delegated User Store Adapter Project Details: `src\CoreIdent.Adapters.DelegatedUserStore`
134
139
@@ -145,7 +150,7 @@ This is the central library containing the core logic, interfaces, and models.
145
150
*`AuthorizationCodeFlowTests.cs`: Tests for the Authorization Code Flow with PKCE (including happy path and negative path tests).
146
151
*`RefreshTokenEndpointTests.cs`: Tests for the token refresh endpoint, including token theft detection scenarios.
147
152
***`CoreIdent.TestHost`:** A helper project providing a shared `WebApplicationFactory` for integration tests.
148
-
***Frameworks:** Uses `xUnit` as the test runner and `Shouldly` for assertions. Mocking is done using `Moq`.
153
+
***Frameworks:** Uses `xUnit`(v3 - see [What's New](https://xunit.net/docs/getting-started/v3/whats-new) and [Migration Guide](https://xunit.net/docs/getting-started/v3/migration)) as the test runner and `Shouldly` for assertions. Mocking is done using `Moq`.
149
154
150
155
## 8. Documentation & Root Files
151
156
@@ -190,7 +195,10 @@ This is the central library containing the core logic, interfaces, and models.
Copy file name to clipboardExpand all lines: README.md
+27-65Lines changed: 27 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ Tired of wrestling with complex identity vendors or rolling your own auth from s
53
53
54
54
**Where CoreIdent is heading (Future Phases):**
55
55
56
-
***Full OAuth 2.0 / OIDC Server:** Implementing remaining standard flows (Client Credentials, Implicit, Hybrid) for web apps, SPAs, mobile apps, and APIs.
56
+
***Full OAuth 2.0 / OIDC Server:** Implementing remaining standard flows (~~Client Credentials~~, Implicit, Hybrid) for web apps, SPAs, mobile apps, and APIs.
57
57
***OIDC Compliance:** Discovery (`/.well-known/openid-configuration`), JWKS (`/.well-known/jwks.json`), ID Tokens.
58
58
***User Interaction:** Consent screens, standard logout endpoints.
59
59
***Extensible Provider Model:**
@@ -69,6 +69,11 @@ Tired of wrestling with complex identity vendors or rolling your own auth from s
*`POST /auth/token` (grant_type=refresh_token) (or configured path): Exchange a valid refresh token for new tokens.
494
+
***Request Body (form-urlencoded)**: `grant_type=refresh_token&refresh_token=abcdef123456...`
495
+
***Response Body**: (Same as login, potentially without refresh token depending on config/flow)
486
496
***Security**: Implements refresh token rotation and **token theft detection** (family tracking & revocation) by default. You can opt-out via `CoreIdentOptions.TokenSecurity.EnableTokenFamilyTracking = false`.
487
497
488
498
**OAuth 2.0 / OIDC Endpoints (Phase 3):**
489
499
490
-
*`GET /auth/authorize`: Initiates the Authorization Code flow. Validates the request, authenticates the user, and redirects back with an authorization code.
500
+
*`GET /auth/authorize` (or configured path): Initiates the Authorization Code flow.
***EF Core:** Provides persistence for users, refresh tokens, clients, scopes, **and authorization codes**. Requires `CoreIdent.Storage.EntityFrameworkCore` and DB migrations. **Expired authorization codes are cleaned up automatically by a background service.**
@@ -574,56 +588,4 @@ Contributions, feedback, and ideas are highly welcome! Please refer to the (upco
574
588
575
589
### Why does the DI registration order matter?
576
590
**Order is critical** because:
577
-
-`AddCoreIdent()` registers the core services and default (in-memory) stores.
578
-
-`AddDbContext<YourDbContext>()` registers your EF Core context in the DI container.
579
-
-`AddCoreIdentEntityFrameworkStores<YourDbContext>()` replaces the in-memory stores with EF Core-backed implementations, which depend on your DbContext being registered first.
580
-
581
-
If you call `AddCoreIdentEntityFrameworkStores` before `AddDbContext`, the EF Core stores will not be able to resolve the context and will fail at runtime.
582
-
583
-
### Common Issues & Solutions
584
-
585
-
-**Error: "No service for type 'YourDbContext' has been registered."**
586
-
-**Solution:** Ensure you called `AddDbContext<YourDbContext>()`*before*`AddCoreIdentEntityFrameworkStores<YourDbContext>()`.
587
-
588
-
-**Error: "Table 'Users'/'RefreshTokens' does not exist" or similar database errors**
589
-
-**Solution:** You likely have not run EF Core migrations. See the migration instructions below.
590
-
591
-
-**Error: "Cannot access a disposed object" (when using SQLite in-memory for tests)**
592
-
-**Solution:** Ensure the SQLite connection remains open for the lifetime of your test host. See integration test examples for details.
Then let's implement the next unimplemented feature in the DEVPLAN checklist.
4
+
- If you are going to create new files, do not presume the LLMINDEX.md is up-to-date, meaning always scan the project for similar looking files or for files that contain multiple classes that might have what you might be otherwise creating.
5
+
- Always create unit or integration tests for every new feature.
6
+
- Always run `dotnet test` and debug the tests before calling the feature completed
7
+
- Clean up any lingering build warnings
8
+
- The feature isn't done until the checklist item(s) in DEVPLAN.md is checked (edit the file)
0 commit comments