From 340c8e8426f5792b63e4a525ffb41b0f826b4a0e Mon Sep 17 00:00:00 2001 From: Takashi Norimatsu Date: Thu, 20 Sep 2018 13:52:30 +0900 Subject: [PATCH] KEYCLOAK-8327 Token Introspect Test for Refresh Token Mistake --- .../org/keycloak/testsuite/oauth/TokenIntrospectionTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java index 19b0f21e06..6f6bf1085d 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java @@ -136,7 +136,7 @@ public class TokenIntrospectionTest extends AbstractTestRealmKeycloakTest { EventRepresentation loginEvent = events.expectLogin().assertEvent(); String sessionId = loginEvent.getSessionId(); AccessTokenResponse accessTokenResponse = oauth.doAccessTokenRequest(code, "password"); - String tokenResponse = oauth.introspectRefreshTokenWithClientCredential("confidential-cli", "secret1", accessTokenResponse.getAccessToken()); + String tokenResponse = oauth.introspectRefreshTokenWithClientCredential("confidential-cli", "secret1", accessTokenResponse.getRefreshToken()); ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(tokenResponse); @@ -150,6 +150,7 @@ public class TokenIntrospectionTest extends AbstractTestRealmKeycloakTest { assertTrue(jsonNode.has("aud")); assertTrue(jsonNode.has("iss")); assertTrue(jsonNode.has("jti")); + assertTrue(jsonNode.has("typ")); TokenMetadataRepresentation rep = objectMapper.readValue(tokenResponse, TokenMetadataRepresentation.class); @@ -161,6 +162,7 @@ public class TokenIntrospectionTest extends AbstractTestRealmKeycloakTest { assertEquals(jsonNode.get("nbf").asInt(), rep.getNotBefore()); assertEquals(jsonNode.get("iss").asText(), rep.getIssuer()); assertEquals(jsonNode.get("jti").asText(), rep.getId()); + assertEquals(jsonNode.get("typ").asText(), "Refresh"); } @Test