dotnet / dotnet/aspnetcore

user-jwts cannot handle multiple claims with the same name

Open
#59,671 0 comments 4 reactions 0 assignees View on GitHub
area-commandlinetools
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [x] 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.