KEYCLOAK-2102 added AbstractKerberosTest.caseInsensitiveTest

This commit is contained in:
mposolda 2015-11-18 12:34:22 +01:00
parent 81eb1e1e30
commit bc22abf8cb
2 changed files with 42 additions and 1 deletions

View file

@ -129,6 +129,33 @@ public abstract class AbstractKerberosTest {
events.clear(); 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 @Test
public void usernamePasswordLoginTest() throws Exception { public void usernamePasswordLoginTest() throws Exception {

View file

@ -76,6 +76,20 @@ userPassword: theduke
krb5PrincipalName: jduke@KEYCLOAK.ORG krb5PrincipalName: jduke@KEYCLOAK.ORG
krb5KeyVersionNumber: 0 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 dn: uid=gsstestserver,ou=People,dc=keycloak,dc=org
objectClass: top objectClass: top
objectClass: person objectClass: person