mercure icon indicating copy to clipboard operation
mercure copied to clipboard

Binary secret

Open Spomky opened this issue 6 years ago • 2 comments

Hi,

When starting the server, the env var JWT_KEY, PUBLISHER_JWT_KEY and SUBSCRIBER_JWT_KEY contain the secret key used to verify the tokens. The problem is that we cannot use a binary secret.

Is it possible to add an option to allow the use of encoded secret (hex, b64 or b64 url safe) instead of plaintext secret for these env vars?

EDIT: had a look to #82 and in fact it would be better to support JWK. Should wait for https://github.com/dgrijalva/jwt-go/issues/249

Spomky avatar Jul 04 '19 15:07 Spomky

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 02 '20 09:09 stale[bot]

As far as I can tell, this was never implemented for HS256 keys?

Related:

  • https://pkg.go.dev/github.com/golang-jwt/jwt/v5#SigningMethodHMAC.Sign
  • https://pkg.go.dev/github.com/golang-jwt/jwt/v5#SigningMethodHMAC.Verify
  • https://golang-jwt.github.io/jwt/usage/signing_methods/#signing-methods-and-key-types

TL;DR: The API is designed to discourage misuse, but we misuse it anyway... 😆

teohhanhui avatar May 12 '25 22:05 teohhanhui

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 18 '25 22:07 stale[bot]