Closed artooro closed 3 months ago
If setting sign_alg
doesn't work, could you help adding unit test to this fix? TIA :)
@ggicci yes of course, sign_alg
was set to EdDSA
in my testing. The entire Caddyfile I used for testing was.
{
order jwtauth before basicauth
}
:8853 {
jwtauth {
sign_key "...."
sign_alg EdDSA
from_header X-Auth-Token
}
respond "it worked"
}
Can look at adding units tests to this PR as well.
@ggicci unit test added, hope it's OK to merge now.
Thank you!
When using caddy-jwt with an ed25519 key, I was not able to get it to work. The caddy log would always show
The code change in this PR checks if the signing key is using the
EdDSA
algorithm of which ed25519 is practically the only key type ever used, and then adds it to the key sink as the proper type.