Skip to content

Add jwt create command and createJwtToken endpoint. Closes #882 #891

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

Merged
merged 11 commits into from
Sep 25, 2024

Conversation

garrytrinder
Copy link
Contributor

No description provided.

@garrytrinder garrytrinder requested a review from a team September 23, 2024 11:53
@garrytrinder garrytrinder linked an issue Sep 23, 2024 that may be closed by this pull request
@waldekmastykarz
Copy link
Collaborator

Noticed one more thing: if you specify a claim with the same name as one of the options (eg. sub), the token generator adds it to the collection of values rather than replacing the value. In some cases (again sub) this leads to incorrect types (sub is expected to be a string, but becomes string[]). Not sure if it's an issue, but perhaps something for us to include in remarks for clarity.

Repro:

$devproxy jwt create -n Steve -a 123 -r App.Read.All -r App.Write.All -s Foo Bar -i bob --claims "aud 456" --claims "sub Jack"

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IlN0ZXZlIiwic3ViIjpbIlN0ZXZlIiwiSmFjayJdLCJqdGkiOiJjNjRiZjFhNCIsInNjb3BlIjpbIkZvbyIsIkJhciJdLCJyb2xlIjpbIkFwcC5SZWFkLkFsbCIsIkFwcC5Xcml0ZS5BbGwiXSwiYXVkIjpbIjQ1NiIsIjEyMyJdLCJuYmYiOjE3MjcwOTc5NjksImV4cCI6MTcyNzQyMTk2OSwiaWF0IjoxNzI3MDk3OTY5LCJpc3MiOiJib2IifQ.7YnArYlXGStA8CQNc0RD_At40wYnfMihsySm4HFcd-c

@waldekmastykarz waldekmastykarz marked this pull request as draft September 23, 2024 15:36
@garrytrinder garrytrinder marked this pull request as ready for review September 24, 2024 10:48
@waldekmastykarz waldekmastykarz marked this pull request as draft September 24, 2024 11:51
@waldekmastykarz
Copy link
Collaborator

Marking as draft until we add the API

@garrytrinder garrytrinder force-pushed the 882-create-jwt-token-command branch from 791d8f9 to 8d43284 Compare September 24, 2024 12:00
@garrytrinder garrytrinder marked this pull request as ready for review September 24, 2024 16:30
@garrytrinder garrytrinder changed the title Add jwt create command. Closes #882 Add jwt create command and createJwtToken endpoint. Closes #882 Sep 24, 2024
Copy link
Collaborator

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@waldekmastykarz waldekmastykarz merged commit 92f9373 into dotnet:main Sep 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create JWT token command
2 participants