Rename EnrolledKeyId → LocalKeyHandle; clarify AP enrollment key identifiers#22
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
dasiths
May 27, 2026 13:46
View session
There was a problem hiding this comment.
Pull request overview
This PR clarifies AP enrollment key identifier semantics by separating the agent-local keystore handle from AP-owned identifiers, and updates SDK docs/samples around LocalKeyHandle.
Changes:
- Renames
EnrollResult.EnrolledKeyIdtoLocalKeyHandleand defaults it to the durable key’s JWK thumbprint. - Collapses AP refresh to the local-handle based overload and updates
AgentProviderTokenRefreshernaming/docs. - Sweeps samples, docs, and planning files to explain AP/agent keystore separation and renamed config keys.
Show a summary per file
| File | Description |
|---|---|
src/AAuth/Agent/AgentProviderClient.cs |
Updates enrollment/refresh API, result properties, and XML docs. |
src/AAuth/Agent/AgentProviderTokenRefresher.cs |
Renames refresher local key reference and docs. |
tests/AAuth.Tests/Agent/AgentProviderTokenRefresherTests.cs |
Renames constructor validation test. |
samples/AgentConsole/Program.cs |
Switches enrollment result usage to LocalKeyHandle. |
samples/GuidedTour/CodeSnippets.cs |
Updates tour snippets for renamed enrollment fields. |
samples/Orchestrator/Program.cs |
Updates commented refresh example. |
samples/SampleApp/EnrollmentService.cs |
Renames stored enrollment key handle state. |
samples/SampleApp/Components/Pages/Jwt.razor |
Uses LocalKeyHandle when loading enrolled key. |
samples/SampleApp/Components/Pages/JwksUri.razor |
Updates enrollment display and key handle usage. |
docs/concepts.md |
Clarifies AP role and keystore separation. |
docs/getting-started.md |
Updates enrollment/config examples. |
docs/reference/dependency-injection.md |
Updates DI examples to use local key handles. |
docs/signing-modes/agent-token-jwt.md |
Updates JWT signing mode config key. |
docs/workflows/bootstrap-enrollment.md |
Rewrites enrollment identifier guidance and diagrams. |
docs/workflows/call-chaining.md |
Updates config and refresher examples. |
docs/workflows/deferred-consent.md |
Updates config examples. |
docs/workflows/federated-access.md |
Updates config examples. |
docs/workflows/identity-based-access.md |
Updates config example. |
docs/workflows/ps-asserted-access.md |
Updates config and refresher examples. |
docs/workflows/resource-managed-access.md |
Updates config example. |
.agent/plans/2026-05-27-ap-enrollment-key-naming/research.md |
Adds research notes for identifier semantics. |
.agent/plans/2026-05-27-ap-enrollment-key-naming/implementation-plan.md |
Adds phased implementation plan. |
Copilot's findings
- Files reviewed: 22/22 changed files
- Comments generated: 6
Copilot
AI
changed the title
Rename EnrolledKeyId → LocalKeyHandle; clarify AP enrollment key identifiers
AgentConsole: send AP-published kid in jwks_uri signing mode
May 27, 2026
- Updated IKeyStore interface methods to use local key handles instead of key IDs for better clarity and consistency. - Enhanced documentation to clarify the usage of the local key handle and the importance of the AP-published kid for jwks_uri signing mode. - Modified samples and documentation to reflect changes in key handling and jwks_uri integration. - Implemented two-key refresh mechanism in AgentProviderClient, allowing for more secure token refresh using ephemeral keys. - Added NamingJwtBuilder to facilitate the creation of naming JWTs for two-key refresh, ensuring compliance with the bootstrap spec. - Updated AgentProviderTokenRefresher to support both single-key and two-key refresh modes, improving flexibility in token management.
…ple components; enhance documentation for jkt-jwt signing mode and agent key management.
…ion for key rotation
… enhance navigation
…ion) - Middleware validates naming JWT 'exp' claim with clock-skew support for jkt-jwt scheme - Moved exp validation from resolver to middleware (clock-aware, respects ClockSkew option) - WhoAmI sample registers InMemoryJtiStore for replay detection - New NamingJwtValidationTests: 5 tests covering valid/expired/clock-skew/replay scenarios - Updated JktJwtAndEcdsaTests to reflect resolver no longer validates exp - Implementation plan updated with Phase 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames
EnrollResult.EnrolledKeyId→LocalKeyHandle, defaults to JWK thumbprint, and clarifies the separation between three distinct identifiers: JWK thumbprint, AP-internal JWTkid, and local keystore handle.Changes by Phase
Phase 1 — SDK changes
EnrollResult.EnrolledKeyIdrenamed toLocalKeyHandle(defaults to JWK thumbprint)EnrollResult.AgentTokenKidadded — AP-published JWKS key id (required forjwks_urimode)RefreshAsyncoverloads into one (removed unusedcurrentAgentTokenparam)AgentProviderTokenRefresherparameters renamed, XML docs updatedPhase 2 — Tests
Phase 3 — Samples
EnrolledKeyIdtoLocalKeyHandleAgentTokenKidin enrollment cachePhase 4 — Docs
bootstrap-enrollment.mdrewritten with three-identifier tableAAuth:LocalKeyHandleconcepts.md,getting-started.md,dependency-injection.mdclarifiedPhase 5 — Review fix-ups
JwksUri.razorandGuidedTour/CodeSnippets.csuseAgentTokenKidfor kid paramkeyIdtolocalKeyHandlelocalKeyHandleconsistentlyJwt.razorillustrative HTML updatedAgentTokenKidXML doc corrected — required for jwks_uri, not "diagnostic only"Phase 6 — SDK improvements
IKeyStoreparameter renamed fromkeyIdtohandleAAuthClientBuilder.From(EnrollResult)convenience APIjkt-jwt) refresh:NamingJwtBuilder,RefreshTwoKeyAsync,RefreshMode.TwoKey/refreshacceptsjkt-jwtschemePhase 7 — jkt-jwt resource endpoint and sample routing
/jkt-jwtendpoint withRequireIssuerVerification = false/jkt-jwt(2-party pseudonymous, not 3-party)JktJwt.razorpage added--psvalidation fixed (onlyjwtrequires PS)Phase 8 — Naming JWT security hardening
expclaim (clock-skew-aware)InMemoryJtiStorefor jti replay detectionVerification
dotnet build— 0 errors, 0 warningsdotnet test— 576 tests, 0 failures--ps(pseudonymous 2-party, no Person Server)