Adapt to Spring Security deprecations

This commit is contained in:
Moritz Halbritter
2025-01-17 08:47:14 +01:00
parent 6957557fd7
commit 3beec788f9
2 changed files with 10 additions and 6 deletions

View File

@@ -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();
}
}

View File

@@ -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();
}
}