diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java index ac858ddb16..4e52db00c7 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java @@ -127,7 +127,34 @@ public abstract class AbstractKerberosTest { spnegoResponse.close(); events.clear(); - } + } + + // KEYCLOAK-2102 + @Test + public void spnegoCaseInsensitiveTest() throws Exception { + KeycloakRule keycloakRule = getKeycloakRule(); + AssertEvents events = getAssertEvents(); + + Response spnegoResponse = spnegoLogin("MyDuke", "theduke"); + Assert.assertEquals(302, spnegoResponse.getStatus()); + + events.expectLogin() + .client("kerberos-app") + .user(keycloakRule.getUser("test", "myduke").getId()) + .detail(Details.REDIRECT_URI, KERBEROS_APP_URL) + //.detail(Details.AUTH_METHOD, "spnego") + .detail(Details.USERNAME, "myduke") + .assertEvent(); + + String location = spnegoResponse.getLocation().toString(); + driver.navigate().to(location); + + String pageSource = driver.getPageSource(); + Assert.assertTrue(pageSource.contains("Kerberos Test") && pageSource.contains("Kerberos servlet secured content")); + + spnegoResponse.close(); + events.clear(); + } @Test diff --git a/testsuite/integration/src/test/resources/kerberos/users-kerberos.ldif b/testsuite/integration/src/test/resources/kerberos/users-kerberos.ldif index fd9936cfa9..9d55092804 100644 --- a/testsuite/integration/src/test/resources/kerberos/users-kerberos.ldif +++ b/testsuite/integration/src/test/resources/kerberos/users-kerberos.ldif @@ -76,6 +76,20 @@ userPassword: theduke krb5PrincipalName: jduke@KEYCLOAK.ORG krb5KeyVersionNumber: 0 +dn: uid=MyDuke,ou=People,dc=keycloak,dc=org +objectClass: top +objectClass: person +objectClass: inetOrgPerson +objectClass: krb5principal +objectClass: krb5kdcentry +cn: My +sn: Duke +mail: MyDuke@keycloak.org +uid: MyDuke +userPassword: theduke +krb5PrincipalName: MyDuke@KEYCLOAK.ORG +krb5KeyVersionNumber: 0 + dn: uid=gsstestserver,ou=People,dc=keycloak,dc=org objectClass: top objectClass: person