Closed keyboardsamurai closed 8 years ago
Reading up on how base64 encoding should be handled in https://www.rfc-editor.org/rfc/rfc7515.txt tells me that padding should not be added. It would be nice to have some leniency, let alone better error handling, but I guess my client library is mostly at fault here.
Just in case anyone comes across this issue and is interested in supporting more lenient padding handling, swap out the fromBase64 method in JsonWebTokenUtils with this while you get your client library fixed.
public static byte[] fromBase64(String input) {
if(input.contains("=")){
return BaseEncoding.base64().decode(input);
}else{
return BaseEncoding.base64Url().omitPadding().decode(input);
}
}
Using dropwizard-auth-jwt version 0.8.1-1 and dropwizard 0.8.1. According to the form on http://jwt.io/ this here is a perfectly valid header:
When I try to send it to the server though I get an Exception because the decoding part doesn't seem to expect the padding '=' characters.
Here is the Exception: