Skip to content

user-jwts cannot handle multiple claims with the same name #59671

Open
@smfields

Description

@smfields

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When a JWT has multiple claims with the same name (type) then most applications will create that claim as an array. One example is Auth0 which generates tokens with a "permissions" claim that is an array of permissions that the user has. Currently there does not appear to be a way to generate similar JWTs using user-jwts because it prohibits creating multiple claims with the same name.

dotnet user-jwts create --claim permissions=read --claim permissions=write

An item with the same key has already been added. Key: permissions

Expected Behavior

No response

Steps To Reproduce

dotnet user-jwts create --claim permissions=read --claim permissions=write

Exceptions (if any)

An item with the same key has already been added. Key: permissions

.NET Version

9.0.101

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions