Add agent identity extension methods for ClaimsPrincipal and ClaimsIdentity#3515
Conversation
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
…s project Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Co-authored-by: keegan-caruso <54109988+keegan-caruso@users.noreply.github.com>
|
@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. |
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