Skip to content

Allow the typ header field to have values other than JWT #277

@errhammr

Description

@errhammr

Summary

The command line interface of jwt-cli alows the typ header field to be specified. The only value it accepts is JWT, though.

There are specifications that recommend or require the typ header field to be something other than JWT. For testing and debugging things using these tokens it would be convenient if jwt-cli allowed the typ header value to be set to a custom value.

Examples:

the "typ" value used SHOULD be "secevent+jwt".

For the PASSporT, the "typ" header MUST be the string "passport".

Steps to reproduce

$ jwt encode --secret @private-key.pem --alg ES256 --iss=demo --typ='secevent+jwt' 
error: invalid value 'secevent+jwt' for '--typ <type>'
  [possible values: jwt]

For more information, try '--help'.

Expected behavior

jwt-cli emits a JWT with the typ header field containing the value given in the --typ command line argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions