Configure signature algorithm when using public key jwt decoder
See gh-20523
This commit is contained in:
parent
a2d70d46e1
commit
69e33d6e62
|
@ -78,7 +78,8 @@ class OAuth2ResourceServerJwtConfiguration {
|
||||||
JwtDecoder jwtDecoderByPublicKeyValue() throws Exception {
|
JwtDecoder jwtDecoderByPublicKeyValue() throws Exception {
|
||||||
RSAPublicKey publicKey = (RSAPublicKey) KeyFactory.getInstance("RSA")
|
RSAPublicKey publicKey = (RSAPublicKey) KeyFactory.getInstance("RSA")
|
||||||
.generatePublic(new X509EncodedKeySpec(getKeySpec(this.properties.readPublicKey())));
|
.generatePublic(new X509EncodedKeySpec(getKeySpec(this.properties.readPublicKey())));
|
||||||
return NimbusJwtDecoder.withPublicKey(publicKey).build();
|
return NimbusJwtDecoder.withPublicKey(publicKey)
|
||||||
|
.signatureAlgorithm(SignatureAlgorithm.from(this.properties.getJwsAlgorithm())).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] getKeySpec(String keyValue) {
|
private byte[] getKeySpec(String keyValue) {
|
||||||
|
|
Loading…
Reference in New Issue