Skip to content

Commit b69054d

Browse files
committed
Remove lying test
There is no verification of issuer at all. The only reason the test still "passes" is because the JSON response has the active attribute as the JSON string "true" rather than the boolean true which is not accepted. Choose to remove the test rather than adding issuer verification since the class is deprecated and will most likely be removed in a future release. Signed-off-by: Andreas Svanberg <[email protected]>
1 parent b466ac9 commit b69054d

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

oauth2/oauth2-resource-server/src/test/java/org/springframework/security/oauth2/server/resource/introspection/NimbusOpaqueTokenIntrospectorTests.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ public class NimbusOpaqueTokenIntrospectorTests {
9696
+ " }";
9797
// @formatter:on
9898

99-
// @formatter:off
100-
private static final String MALFORMED_ISSUER_RESPONSE = "{\n"
101-
+ " \"active\" : \"true\",\n"
102-
+ " \"iss\" : \"badissuer\"\n"
103-
+ " }";
104-
// @formatter:on
105-
10699
// @formatter:off
107100
private static final String MALFORMED_SCOPE_RESPONSE = "{\n"
108101
+ " \"active\": true,\n"
@@ -241,18 +234,6 @@ public void introspectWhenIntrospectionTokenReturnsInvalidResponseThenInvalidTok
241234
}
242235
}
243236

244-
@Test
245-
public void introspectWhenIntrospectionTokenReturnsMalformedIssuerResponseThenInvalidToken() throws IOException {
246-
try (MockWebServer server = new MockWebServer()) {
247-
server.setDispatcher(requiresAuth(CLIENT_ID, CLIENT_SECRET, MALFORMED_ISSUER_RESPONSE));
248-
String introspectUri = server.url("/introspect").toString();
249-
OpaqueTokenIntrospector introspectionClient = new NimbusOpaqueTokenIntrospector(introspectUri, CLIENT_ID,
250-
CLIENT_SECRET);
251-
assertThatExceptionOfType(OAuth2IntrospectionException.class)
252-
.isThrownBy(() -> introspectionClient.introspect("token"));
253-
}
254-
}
255-
256237
// gh-7563
257238
@Test
258239
public void introspectWhenIntrospectionTokenReturnsMalformedScopeThenEmptyAuthorities() throws IOException {

0 commit comments

Comments
 (0)