user-jwts does not support different Name and NameIdentifier claim
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
basically what I want is to set `name` and `nameIdentifier` to different values, this is what I am trying to accomplish.
I am using user-jwts and here is my command
`dotnet user-jwts create --claim "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier=hakan@example.com" --claim "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name=hakan"`
I am not providing the `--name`, I know, but I tried that, and did not achieve what I wanted either.
what I am getting basically from the above command is duplicated claims, I am getting the `name` claim twice, and the `name identifier` twice,
The first pair of `name` and `nameidentifier` claims are set to the default windows user (this is expected by the documentation as I am not specifying anything to the --name option)
the second pair of `name` and `nameidentifier` claims are set to the second claim I specify in the above command `hakan`.
What I am trying to do is just set those 2 claims to different values (without duplicating them).
Is this a bug? or is this by design?
I tried to work around this by using IClaimsTransformation interface, but it only allow to add new claims not to modify or deleted the duplicated claims.
if this is confirmed a bug, maybe I can help with it
Thank you
### Expected Behavior
`name` and `nameidentifier` claims should be allowed to set to different values
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### .NET Version
7.0.401
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.