|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
* Copyright 2012-2020 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -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) {
|
|
|
|