Keats / jsonwebtoken

JWT lib in rust
MIT License
1.62k stars 252 forks source link

JWK hmac keys are base64url encoded not standard #316

Closed sjoerdsimons closed 1 year ago

sjoerdsimons commented 1 year ago

DecodingKey::from_base64_secret uses standard decoding, while "k" field of a jwk is expected to be in base64url instead.

Keats commented 1 year ago

Can you add a test that was failing before?

sjoerdsimons commented 1 year ago

Can you add a test that was failing before?

Done; without the first commit this test would fail with: thread 'verify_hs256_rfc7517_appendix_a1' panicked at 'calledResult::unwrap()on anErrvalue: Error(Base64(InvalidByte(34, 45)))', tests/hmac.rs:199:43

Keats commented 1 year ago

Thanks!