From 3beec788f90fed1150577a564568666b6ed8662f Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Fri, 17 Jan 2025 08:47:14 +0100 Subject: [PATCH] Adapt to Spring Security deprecations --- ...ctiveOAuth2ResourceServerOpaqueTokenConfiguration.java | 8 +++++--- .../OAuth2ResourceServerOpaqueTokenConfiguration.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerOpaqueTokenConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerOpaqueTokenConfiguration.java index f4d9614253..3fe7ea43ab 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerOpaqueTokenConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerOpaqueTokenConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,8 +46,10 @@ class ReactiveOAuth2ResourceServerOpaqueTokenConfiguration { @ConditionalOnProperty(name = "spring.security.oauth2.resourceserver.opaquetoken.introspection-uri") SpringReactiveOpaqueTokenIntrospector opaqueTokenIntrospector(OAuth2ResourceServerProperties properties) { OAuth2ResourceServerProperties.Opaquetoken opaqueToken = properties.getOpaquetoken(); - return new SpringReactiveOpaqueTokenIntrospector(opaqueToken.getIntrospectionUri(), - opaqueToken.getClientId(), opaqueToken.getClientSecret()); + return SpringReactiveOpaqueTokenIntrospector.withIntrospectionUri(opaqueToken.getIntrospectionUri()) + .clientId(opaqueToken.getClientId()) + .clientSecret(opaqueToken.getClientSecret()) + .build(); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerOpaqueTokenConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerOpaqueTokenConfiguration.java index a995db7d89..e2c28a88ad 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerOpaqueTokenConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerOpaqueTokenConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,8 +48,10 @@ class OAuth2ResourceServerOpaqueTokenConfiguration { @ConditionalOnProperty(name = "spring.security.oauth2.resourceserver.opaquetoken.introspection-uri") SpringOpaqueTokenIntrospector opaqueTokenIntrospector(OAuth2ResourceServerProperties properties) { OAuth2ResourceServerProperties.Opaquetoken opaqueToken = properties.getOpaquetoken(); - return new SpringOpaqueTokenIntrospector(opaqueToken.getIntrospectionUri(), opaqueToken.getClientId(), - opaqueToken.getClientSecret()); + return SpringOpaqueTokenIntrospector.withIntrospectionUri(opaqueToken.getIntrospectionUri()) + .clientId(opaqueToken.getClientId()) + .clientSecret(opaqueToken.getClientSecret()) + .build(); } }