Skip to content

Update user-jwts to support new Identity bearer tokens #49416

@DamianEdwards

Description

@DamianEdwards

We've added support to ASP.NET Core Identity in .NET 8 for included API endpoints that can issue authentication cookies or tokens. The dotnet user-jwts tool we added in .NET 7 should be updated to support this new token format so that it's simple to create authentication tokens that are stored in the project's user secrets location and be used in local dev scenarios.

Work required:

  • Alias the tool to dotnet user-tokens so that both user-jwts and user-tokens are supported command invocations
  • Add a new --format parameter to the create command that accepts jwt and token options, defaulting to jwt to maintain backwards compatibility with the existing behavior.
  • Update the command help text to replace references to "JWT" with "token" as appropriate

Open questions:

  • ❔Should the --format parameter accept a cookie value to enable creating valid Identity cookies?
  • ❔Which existing options on create don't apply when --format token is specified, e.g. --issuer? The tool should fail and display a helpful error message if those are specified when using --format token
  • ❔Are there any new options required on create for customizing the creation of tokens in the new format?
  • ❔Are there any Data Protection related items to consider given that the new tokens are protected using the app's configured Data Protection settings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIarea-identityIncludes: Identity and providersenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-token-identityfeature-userjwtsThe `dotnet user-jwts` CLI tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions