From d4bd053030411ba8003151aa7e73745e7e80a26f Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Thu, 31 Jul 2025 16:24:25 +0800 Subject: [PATCH] Fix wrong "public-key-location" configuration key See gh-46627 Signed-off-by: Yanming Zhou --- .../oauth2/resource/OAuth2ResourceServerProperties.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java index 74383f8aed3..1f3508e62ae 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java @@ -36,6 +36,7 @@ import org.springframework.util.StreamUtils; * @author Artsiom Yudovin * @author Mushtaq Ahmed * @author Yan Kardziyaka + * @author Yanming Zhou * @since 2.1.0 */ @ConfigurationProperties(prefix = "spring.security.oauth2.resourceserver") @@ -174,7 +175,7 @@ public class OAuth2ResourceServerProperties { } public String readPublicKey() throws IOException { - String key = "spring.security.oauth2.resourceserver.public-key-location"; + String key = "spring.security.oauth2.resourceserver.jwt.public-key-location"; Assert.notNull(this.publicKeyLocation, "PublicKeyLocation must not be null"); if (!this.publicKeyLocation.exists()) { throw new InvalidConfigurationPropertyValueException(key, this.publicKeyLocation,