Skip to content

Commit bd48175

Browse files
Merge branch 'spring-projects:main' into main
2 parents c7cfa5f + 126cb71 commit bd48175

File tree

9 files changed

+44
-14
lines changed

9 files changed

+44
-14
lines changed

docs/modules/ROOT/pages/reactive/oauth2/resource-server/opaque-token.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spring:
2828
security:
2929
oauth2:
3030
resourceserver:
31-
opaque-token:
31+
opaquetoken:
3232
introspection-uri: https://idp.example.com/introspect
3333
client-id: client
3434
client-secret: secret
@@ -622,7 +622,7 @@ spring:
622622
security:
623623
oauth2:
624624
resourceserver:
625-
opaque-token:
625+
opaquetoken:
626626
introspection-uri: https://idp.example.org/introspection
627627
client-id: client
628628
client-secret: secret

docs/modules/ROOT/pages/servlet/oauth2/resource-server/opaque-token.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spring:
2727
security:
2828
oauth2:
2929
resourceserver:
30-
opaque-token:
30+
opaquetoken:
3131
introspection-uri: https://idp.example.com/introspect
3232
client-id: client
3333
client-secret: secret
@@ -791,7 +791,7 @@ spring:
791791
security:
792792
oauth2:
793793
resourceserver:
794-
opaque-token:
794+
opaquetoken:
795795
introspection-uri: https://idp.example.org/introspection
796796
client-id: client
797797
client-secret: secret

gradle/wrapper/gradle-wrapper.jar

59 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionSha256Sum=61ad310d3c7d3e5da131b76bbf22b5a4c0786e9d892dae8c1658d4b484de3caa
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

gradlew.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7474

7575

7676
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7878

7979
:end
8080
@rem End local scope for the variables with windows NT shell

oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrations.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
1717
package org.springframework.security.oauth2.client.registration;
1818

1919
import java.net.URI;
20+
import java.util.ArrayList;
2021
import java.util.LinkedHashMap;
2122
import java.util.List;
2223
import java.util.Map;
@@ -49,6 +50,7 @@
4950
* @author Rob Winch
5051
* @author Josh Cummings
5152
* @author Rafiullah Hamedy
53+
* @author Evgeniy Cheban
5254
* @since 5.1
5355
*/
5456
public final class ClientRegistrations {
@@ -265,6 +267,7 @@ private static Supplier<ClientRegistration.Builder> getRfc8414Builder(String iss
265267
private static ClientRegistration.Builder getBuilder(String issuer,
266268
Supplier<ClientRegistration.Builder>... suppliers) {
267269
String errorMessage = "Unable to resolve Configuration with the provided Issuer of \"" + issuer + "\"";
270+
List<String> errors = new ArrayList<>();
268271
for (Supplier<ClientRegistration.Builder> supplier : suppliers) {
269272
try {
270273
return supplier.get();
@@ -273,6 +276,7 @@ private static ClientRegistration.Builder getBuilder(String issuer,
273276
if (!ex.getStatusCode().is4xxClientError()) {
274277
throw ex;
275278
}
279+
errors.add(ex.getMessage());
276280
// else try another endpoint
277281
}
278282
catch (IllegalArgumentException | IllegalStateException ex) {
@@ -282,6 +286,9 @@ private static ClientRegistration.Builder getBuilder(String issuer,
282286
throw new IllegalArgumentException(errorMessage, ex);
283287
}
284288
}
289+
if (!errors.isEmpty()) {
290+
throw new IllegalArgumentException(errorMessage + ", errors: " + errors);
291+
}
285292
throw new IllegalArgumentException(errorMessage);
286293
}
287294

oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/registration/ClientRegistrationsTests.java

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,12 +37,14 @@
3737
import org.springframework.web.util.UriComponents;
3838

3939
import static org.assertj.core.api.Assertions.assertThat;
40+
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
4041
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
4142
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
4243

4344
/**
4445
* @author Rob Winch
4546
* @author Rafiullah Hamedy
47+
* @author Evgeniy Cheban
4648
* @since 5.1
4749
*/
4850
public class ClientRegistrationsTests {
@@ -581,6 +583,27 @@ public void oidcWhenHostContainsUnderscoreThenRetains() {
581583
assertThat(oidcRfc8414.getHost()).isEqualTo("elated_sutherland");
582584
}
583585

586+
@Test
587+
public void issuerWhenAllEndpointsFailedThenExceptionIncludesFailureInformation() {
588+
this.issuer = createIssuerFromServer("issuer1");
589+
this.server.setDispatcher(new Dispatcher() {
590+
@Override
591+
public MockResponse dispatch(RecordedRequest request) {
592+
int responseCode = switch (request.getPath()) {
593+
case "/issuer1/.well-known/openid-configuration" -> 405;
594+
case "/.well-known/openid-configuration/issuer1" -> 400;
595+
default -> 404;
596+
};
597+
return new MockResponse().setResponseCode(responseCode);
598+
}
599+
});
600+
assertThatExceptionOfType(IllegalArgumentException.class)
601+
.isThrownBy(() -> ClientRegistrations.fromIssuerLocation(this.issuer).build())
602+
.withMessageContaining("405")
603+
.withMessageContaining("400")
604+
.withMessageContaining("404");
605+
}
606+
584607
private ClientRegistration.Builder registration(String path) throws Exception {
585608
this.issuer = createIssuerFromServer(path);
586609
this.response.put("issuer", this.issuer);

web/src/test/java/org/springframework/security/web/authentication/preauth/x509/SubjectDnX509PrincipalExtractorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public void invalidRegexFails() {
4949
}
5050

5151
@Test
52-
public void defaultCNPatternReturnsExcpectedPrincipal() throws Exception {
52+
public void defaultCNPatternReturnsExpectedPrincipal() throws Exception {
5353
Object principal = this.extractor.extractPrincipal(X509TestUtils.buildTestCertificate());
5454
assertThat(principal).isEqualTo("Luke Taylor");
5555
}

0 commit comments

Comments
 (0)