From 021c2ec7018dd35c2eea6acf17e918384bd5c0c9 Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 15 Jul 2016 09:14:56 +0200 Subject: [PATCH] KEYCLOAK-3220 Added test for missing response_type --- .../testsuite/oauth/AuthorizationCodeTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AuthorizationCodeTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AuthorizationCodeTest.java index 5eddf14aa1..ece81d876e 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AuthorizationCodeTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AuthorizationCodeTest.java @@ -158,6 +158,19 @@ public class AuthorizationCodeTest extends AbstractKeycloakTest { events.expectLogin().error(Errors.NOT_ALLOWED).user((String) null).session((String) null).clearDetails().detail(Details.RESPONSE_TYPE, "token id_token").assertEvent(); } + @Test + public void authorizationRequestMissingResponseType() throws IOException { + oauth.responseType(null); + UriBuilder b = UriBuilder.fromUri(oauth.getLoginFormUrl()); + driver.navigate().to(b.build().toURL()); + + OAuthClient.AuthorizationCodeResponse errorResponse = new OAuthClient.AuthorizationCodeResponse(oauth); + Assert.assertTrue(errorResponse.isRedirected()); + Assert.assertEquals(errorResponse.getError(), OAuthErrorException.INVALID_REQUEST); + + events.expectLogin().error(Errors.INVALID_REQUEST).user((String) null).session((String) null).clearDetails().assertEvent(); + } + @Test public void authorizationRequestInvalidResponseType() throws IOException { oauth.responseType("tokenn");