-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 10258: Compatibility with 6x for bool claims (#2367)
Compatibility with 6x for bool claims (#2367) * Compatibility with 6x for bool claims Fix behavior where ToString is used on bool values resulting in the value being True/False instead of true/false * Use direct ClaimValueType --------- Co-authored-by: Keegan Caruso <keegancaruso@microsoft.com> ---- #### AI-Generated Description The pull request modifies the handling of boolean claims in the JsonWebToken library. It changes the encoding and decoding of boolean values to use lowercase "true" and "false" instead of uppercase "True" and "False". It also adds unit tests to verify the expected behavior. The main changes are in the following files: - **JsonWebTokenTests.cs**: Adds a new test method `BoolClaimsEncodedAsExpected` to check the encoding and decoding of boolean claims. - **JwtPayload.cs**: Adds logic to handle boolean values in the `CreateClaims` and `CreateClaimFromObject` methods. - **JsonClaimSet.cs**: Adds logic to handle boolean values in the `CreateClaimFromObject` and `CreateClaimFromJsonElement` methods.
- Loading branch information
Brent Schmaltz
committed
Oct 17, 2023
1 parent
5c1ea4a
commit 97888a2
Showing
5 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters