-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClaimsPrincipal and ClaimsIdentity type proxies hide properties on derived types #91526
Comments
Should this be fixed in .NET 8 RC2? |
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones Issue DetailsDescriptionA PR to improve debugging claims debugging added type proxies for ClaimsPrincipal and ClaimsIdentity: #86424 These types aren't sealed, and WindowsPrincipal and WindowsIdentity inherit from them and add new properties. For example, WindowsPrincipal.DeviceClaims. These properties are hidden by the type proxies. Two possible solutions:
Reproduction StepsCreate WindowsPrinicipal and debug. Expected behaviorWindowsPrinicipal.DeviceClaims is visible in the default debugging view. Actual behaviorOnly ClaimsPrinicipal properties are visible in the default debugging view. Regression?Yes. These properties were visible by default when debugging .NET 7. Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
As a point of reference, looking across GitHub, I can see a number of places where 3rd parties are deriving from this type. My vote would be a fix that benefits all folks that derive from these types. |
Unfortunately, this doesn't work. There is a bug in Roslyn: dotnet/roslyn#4134 I don't see a good way to make IEnumerable + yield play well with the debugger. A tactical solution could be to change ClaimsPricinpial.Claims to create a Longer term, a way to make IEnumerable + yield show up well with the debugger should be investigated. |
Removing the proxies and add DebuiggerDisplay to the Claims property after dotnet/roslyn#4134 gets fixed (if ever) seems best to me.
Not sure if it's worth to add allocations for debugging purposes. cc @bartonjs |
Description
A PR to improve debugging claims debugging added type proxies for ClaimsPrincipal and ClaimsIdentity: #86424
These types aren't sealed, and WindowsPrincipal and WindowsIdentity inherit from them and add new properties. For example, WindowsPrincipal.DeviceClaims. These properties are hidden by the type proxies.
Two possible solutions:
IEnumerable<Claims>
properties, which I believe could be replaced by placing DebuggerDisplayAttribute on those properties. I haven't seenDebuggerDisplayAttribute
used on properties before, but its attribute usage allows it.Reproduction Steps
Create WindowsPrinicipal and debug.
Expected behavior
WindowsPrinicipal.DeviceClaims is visible in the default debugging view.
Actual behavior
Only ClaimsPrinicipal properties are visible in the default debugging view.
Regression?
Yes. These properties were visible by default when debugging .NET 7.
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: