Being able to generate valid JWT tokens with arbitrary payloads on the command line is useful for testing an debugging. It should be really easy to do...
@Tgr shared the following implementation outline:
$jwtCodec = MediaWikiServices::getInstance()->getJwtCodec();
if ( !$jwtCodec->enabled() ) { /* the wiki admin did not set up the RSA keys */ }
$token = $jwtCodec->create( $claimArray );The script should support creating tokens with the "normal" payload fields that would be used when creating a token for use in a session cookie (see T399198), but allow overriding individual claims on the command line (or from a file?)