Skip to content

Data Protection causes claim value type to default to string #1974

Closed
@schneini

Description

@schneini

Confirm you've already contributed to this project or that you sponsor it

  • I confirm I'm a sponsor or a contributor

Version

5.1.0

Describe the bug

Hi,

we are currently in the process of migrating to OpenIddict 5 and have noticed an issue with the value type of the claims in combination with Data Protection.

It seems that when using Data Protection, the value type will always default to string, causing issues with the strict value type checks added in #1958

If you for example look at the Velusia.Server sample, it will work fine even with data protection because all of the claims used already seem have the value type string. But when adding a claim with a different value type, like for example oi_act_lft, the value type will change from integer to string when the principal is retrieved on the /connect/token endpoint, resulting in an exception.

To reproduce

schneini/openiddict-samples@865b872

Exceptions (if any)

System.InvalidOperationException: The 'oi_act_lft' claim present in the specified principal is malformed or isn't of the expected type.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions