Skip to content

ClaimsPrincipal and ClaimsIdentity type proxies hide properties on derived types #91526

@JamesNK

Description

@JamesNK

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:

  1. Remove type proxies. The proxies improve the display of some IEnumerable<Claims> properties, which I believe could be replaced by placing DebuggerDisplayAttribute on those properties. I haven't seen DebuggerDisplayAttribute used on properties before, but its attribute usage allows it.
  2. Add type proxies for WindowsPrincipal and WindowsIdentity. This would improve debugging of these types, but anyone else who inherits from the base claim types and adds new properties will still have them hidden.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions