Skip to content

Always write an object for ClaimsPrincipal - #1905

Merged
SimonCropp merged 1 commit into
mainfrom
fix-empty-claims-principal
Aug 29, 2026
Merged

Always write an object for ClaimsPrincipal#1905
SimonCropp merged 1 commit into
mainfrom
fix-empty-claims-principal

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

An empty ClaimsPrincipal returned without writing any token, which left the writer in Property state after the caller had written the member name. That threw JsonWriterException for a following member, silently emitted null in trailing position, and produced empty output at the root.

The object is now always written. WriteMember drops the empty Identities collection, so an empty principal renders as {}.

An empty ClaimsPrincipal returned without writing any token, which left the
writer in Property state after the caller had written the member name. That
threw JsonWriterException for a following member, silently emitted null in
trailing position, and produced empty output at the root.

The object is now always written. WriteMember drops the empty Identities
collection, so an empty principal renders as {}.
@SimonCropp SimonCropp added this to the 33.0.0 milestone Aug 29, 2026
@SimonCropp
SimonCropp merged commit 3282c5f into main Aug 29, 2026
6 of 7 checks passed
@SimonCropp
SimonCropp deleted the fix-empty-claims-principal branch August 29, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant