Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
identity: return claims from the verified token, not the pre-parse
Antonio Ojea9c2ba8bfa6e2
diff --git a/internal/identity/oidc.go b/internal/identity/oidc.goindex 979126be..67df8681 100644--- a/internal/identity/oidc.go+++ b/internal/identity/oidc.go@@ -96,5 +96,12 @@ func VerifyJWT(ctx context.Context, jwtStr string, allowedAudiences []string, prreturn nil, nil, fmt.Errorf("JWT validation failed: %w", err)}- return claims, token, nil+ // Return claims decoded from the verified token, not the unverified+ // pre-parse used above only to route to the right issuer.+ verifiedClaims := jwt.MapClaims{}+ if err := token.Claims(&verifiedClaims); err != nil {+ return nil, nil, fmt.Errorf("failed to decode verified claims: %w", err)+ }++ return verifiedClaims, token, nil}