Skip to content

Conversation

@pmaytak
Copy link
Contributor

@pmaytak pmaytak commented Aug 13, 2024

Use CaseSensitiveClaimsIdentity by default.

Add AppContextSwitches to fallback to using ClaimsIdentity.

Add BannedApiAnalyzers to prevent use of ClaimsIdentity constructors and enforce use of CaseSensitiveClaimsIdentity, which makes claims retrieval consistent.

The disallowed definitions are contained in BannedSymbols.txt. There is no wildcard to include all constructors for a type, so each one has to be added.

If a banned member is used, the following error is thrown:
RS0030 The symbol has been marked as banned in this project, and an alternate should be used instead.

@pmaytak pmaytak added this to the 3.1.0 milestone Aug 20, 2024
@pmaytak pmaytak marked this pull request as ready for review August 20, 2024 08:33
@pmaytak pmaytak requested a review from a team as a code owner August 20, 2024 08:33
@pmaytak pmaytak changed the title Add BannedApiAnalyzers to prevent use of ClaimsIdentity constructors Add BannedApiAnalyzers to prevent use of ClaimsIdentity constructors and AppContextSwitches for fallback Aug 20, 2024
Copy link
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks @pmaytak

Assuming the RequireScopeXXX won't introduce a breaking change as we consume the claims identity ourselves?

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

This was referenced Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants