You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which version of Microsoft.IdentityModel are you using?
System.IdentityModel.Tokens.Jwt 7.0.3
Where is the issue?
M.IM.JsonWebTokens
M.IM.KeyVaultExtensions
M.IM.Logging
M.IM.ManagedKeyVaultSecurityKey
M.IM.Protocols
M.IM.Protocols.OpenIdConnect
M.IM.Protocols.SignedHttpRequest
M.IM.Protocols.WsFederation
M.IM.TestExtensions
M.IM.Tokens
M.IM.Tokens.Saml
M.IM.Validators
M.IM.Xml
S.IM.Tokens.Jwt
Other (please describe)
Is this a new or an existing app?
c. This is a new app or an experiment.
Repro
Step 1: Set computer localization to one of west european countries, for example "fr-FR", where decimal separator is comma ,.
In these countries, decimal value 10.9 is written as 10,9.
Step 2: Create a JWT with a decimal type claim in the Payload:
Step 3: Get the claim in the payload. The claim.value has a string value 10,9
Expected behavior
At API level, we would like decimal and datetime data to be represented in invariant culture.
DateTime is perfectly handled with invariant culture: line 522
But all decimal values are not: line 532
Actual behavior
Claim.value is string, from what i have obseved, when the claim is added in the payload with a simple ToString(). The claim value is stored with current culture of the computer (for example: fr-FR, which is not exterchangable with another computer en-US) https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-
Claim.Value stores "10,9", which is not expected at API/data exchange level. We would like all numeric values to be stored as standard iso format.
Possible solution
I think the behaviour can be fixed in these two lines, by adding a check on numberic types (decimal, double, float, ...) and use invariant culture version of string conversion:
Which version of Microsoft.IdentityModel are you using?
System.IdentityModel.Tokens.Jwt 7.0.3
Where is the issue?
Is this a new or an existing app?
c. This is a new app or an experiment.
Repro
Step 1: Set computer localization to one of west european countries, for example "fr-FR", where decimal separator is comma
,
.In these countries, decimal value
10.9
is written as10,9
.Step 2: Create a JWT with a decimal type claim in the Payload:
Step 3: Get the claim in the payload. The claim.value has a string value
10,9
Expected behavior
At API level, we would like decimal and datetime data to be represented in invariant culture.
DateTime is perfectly handled with invariant culture: line 522
But all decimal values are not: line 532
azure-activedirectory-identitymodel-extensions-for-dotnet/src/System.IdentityModel.Tokens.Jwt/JwtPayload.cs
Lines 522 to 532 in 5c65369
Actual behavior
Claim.value is string, from what i have obseved, when the claim is added in the payload with a simple ToString(). The claim value is stored with current culture of the computer (for example: fr-FR, which is not exterchangable with another computer en-US)
https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-
Claim.Value stores "10,9", which is not expected at API/data exchange level. We would like all numeric values to be stored as standard iso format.
Possible solution
I think the behaviour can be fixed in these two lines, by adding a check on numberic types (decimal, double, float, ...) and use invariant culture version of string conversion:
azure-activedirectory-identitymodel-extensions-for-dotnet/src/System.IdentityModel.Tokens.Jwt/JwtPayload.cs
Line 532 in 5c65369
azure-activedirectory-identitymodel-extensions-for-dotnet/src/System.IdentityModel.Tokens.Jwt/JwtPayload.cs
Line 559 in 5c65369
Additional context / logs / screenshots / links to code
please find here a screenshot of debug info of a generated token:
The text was updated successfully, but these errors were encountered: