Use MIME decoder to read OAuth2 resource server public key

Fixes gh-16624
pull/16632/head
Andy Wilkinson 6 years ago
parent dc39540def
commit 915bde0e62

@ -68,8 +68,8 @@ class ReactiveOAuth2ResourceServerJwkConfiguration {
private byte[] getKeySpec(String keyValue) {
keyValue = keyValue.replace("-----BEGIN PUBLIC KEY-----", "")
.replace("-----END PUBLIC KEY-----", "").replace("\n", "");
return Base64.getDecoder().decode(keyValue);
.replace("-----END PUBLIC KEY-----", "");
return Base64.getMimeDecoder().decode(keyValue);
}
@Bean

@ -70,8 +70,8 @@ class OAuth2ResourceServerJwtConfiguration {
private byte[] getKeySpec(String keyValue) {
keyValue = keyValue.replace("-----BEGIN PUBLIC KEY-----", "")
.replace("-----END PUBLIC KEY-----", "").replace("\n", "");
return Base64.getDecoder().decode(keyValue);
.replace("-----END PUBLIC KEY-----", "");
return Base64.getMimeDecoder().decode(keyValue);
}
@Bean

Loading…
Cancel
Save