Skip to content

Support O DateTime(Offset) format in dotnet user-jwts tool #41973

Closed
@martincostello

Description

@martincostello

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When using the new dotnet user-jwts tool, users may paste formatted date times in from other sources (e.g. decoding another existing JWT using something like jwt.io).

Describe the solution you'd like

To make copy-paste in these scenarios, supporting the "O" format would make the tool more user-friendly.

The tool already supports 4 different possible formats:

"yyyy-MM-dd", "yyyy-MM-dd HH:mm", "yyyy/MM/dd", "yyyy/MM/dd HH:mm" };

It displays the values in "O" format from the list command, so would support round-tripping when decoded.

if (showTokens)
{
table.AddRow(jwt.Id, jwt.Scheme, jwt.Audience, jwt.Issued.ToString("O"), jwt.Expires.ToString("O"), jwt.Token);
}
else
{
table.AddRow(jwt.Id, jwt.Scheme, jwt.Audience, jwt.Issued.ToString("O"), jwt.Expires.ToString("O"));
}

Additional context

See #41956 (comment).

/cc @DamianEdwards

Metadata

Metadata

Assignees

Labels

area-authIncludes: Authn, Authz, OAuth, OIDC, Bearer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions