Uh oh!
There was an error while loading. Please reload this page.
Add agent identity extension methods for ClaimsPrincipal and ClaimsIdentity - #3515
Conversation
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
…s project Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: keegan-caruso <54109988+keegan-caruso@users.noreply.github.com>
Jean-Marc Prieur (jmprieur)
commented
Oct 2, 2025
Copilot : let's add other asserts using the ClaimsIdentity extension methods in the Agent identity end to end tests under When the test gets the authorization header, extract the token, read it with JsonWebTokenHandler, and create an untrusted claims identity from the claims in the token. |
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Added assertions in all four AgentUserIdentityTests methods (722ac3b). Each test now extracts the token from the authorization header, parses it with JwtSecurityTokenHandler, creates a CaseSensitiveClaimsIdentity from the claims, and uses IsAgentUserIdentity() and GetParentAgentBlueprint() extension methods to validate the token. |
Jean-Marc Prieur (jmprieur)
left a comment
There was a problem hiding this comment.
Copilot : this is great, I left comments.,
Could we also assert the 2 extension methods on ClaimsIndentity in Autonomous agent tests as well?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Original prompt
Title: Add agent identity extension methods: GetParentAgentBlueprint and IsAgentUserIdentity
Summary
Add extension methods on ClaimsPrincipal and ClaimsIdentity to help developers detect agent identities and retrieve the parent agent blueprint from token claims.
Requirements
Add the following extension methods in a new file under src/Microsoft.Identity.Web.TokenCache:
Add unit tests under tests/Microsoft.Identity.Web.Test to validate the above behaviors.
Notes
Proposed changes