-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Make dotnet user-jwts create scriptable #42146
Copy link
Copy link
Closed
Labels
area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIfeature-userjwtsThe `dotnet user-jwts` CLI toolThe `dotnet user-jwts` CLI toolold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Metadata
Metadata
Assignees
Labels
area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIfeature-userjwtsThe `dotnet user-jwts` CLI toolThe `dotnet user-jwts` CLI toolold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
While looking at #42125 I noticed that, because it's designed for humans to use, the output from the
dotnet user-jwts createcommand is quite "wordy".That's cool, it's a tool to help devs do manual testing of their APIs. They can read it, then copy the token from the terminal.
However, if a dev then wanted to script things with a created JWT, it's suddenly a bit hacky to run the tool and try and parse the output to get the generated JWT.
Describe the solution you'd like
An additional flag that can be passed to
dotnet user-jwts createthat will just output the JWT to the output with no other information (in the case of success, at least).I can't think of a good name for it right now, so for the purpose of the example it's called
--only-output-jwt:Then using PowerShell as an example, you could generate a valid JWT and assign it directly into a variable, then use it to make HTTP requests:
Additional context
No response