Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] JwtPayload no longer supports Guid claim values #2439

Closed
1 of 14 tasks
KevinH-MS opened this issue Jan 9, 2024 · 0 comments · Fixed by #2440
Closed
1 of 14 tasks

[Bug] JwtPayload no longer supports Guid claim values #2439

KevinH-MS opened this issue Jan 9, 2024 · 0 comments · Fixed by #2440
Assignees
Labels
Bug Product is not functioning as expected Customer issued PR Indicates a customer has issued a PR to fix Regression
Milestone

Comments

@KevinH-MS
Copy link
Contributor

Which version of Microsoft.IdentityModel are you using?
Microsoft.IdentityModel.Tokens 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?
The app is in production and I have upgraded to a new version of Microsoft.IdentityModel.*

Repro

using System.IdentityModel.Tokens.Jwt;

var payload = new JwtPayload();
payload.Add("appid", Guid.NewGuid());

var jwt = payload.SerializeToJson();

Expected behavior

jwt == $"{{\"appid\":\"{guid}\"}}"

Actual behavior

System.ArgumentException: 'IDX11025: Cannot serialize object of type: 'System.Guid' into property: 'appid'.'

Possible solution
New serializer logic could serialize Guids as strings (as the Newtonsoft implementation did)...

@keegan-caruso keegan-caruso added this to the 7.2.1 milestone Jan 10, 2024
@jennyf19 jennyf19 added Bug Product is not functioning as expected and removed needs attention untriaged labels Jan 23, 2024
@jennyf19 jennyf19 added the Customer issued PR Indicates a customer has issued a PR to fix label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Product is not functioning as expected Customer issued PR Indicates a customer has issued a PR to fix Regression
Projects
None yet
3 participants