keycloak-uncached
Changes
examples/kerberos/pom.xml 29(+29 -0)
examples/kerberos/README.md 14(+3 -11)
examples/ldap/embedded-ldap/src/main/java/org/keycloak/example/ldap/embedded/EmbeddedLDAPLauncher.java 129(+0 -129)
examples/ldap/ldaprealm.json 0(+0 -0)
examples/ldap/pom.xml 87(+77 -10)
examples/ldap/README.md 12(+4 -8)
testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java 6(+3 -3)
util/embedded-ldap/pom.xml 9(+7 -2)
Details
examples/kerberos/pom.xml 29(+29 -0)
diff --git a/examples/kerberos/pom.xml b/examples/kerberos/pom.xml
index ffe8259..69429f5 100755
--- a/examples/kerberos/pom.xml
+++ b/examples/kerberos/pom.xml
@@ -40,6 +40,11 @@
<artifactId>keycloak-adapter-core</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.keycloak</groupId>
+ <artifactId>keycloak-util-embedded-ldap</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -62,4 +67,28 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>kerberos</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.keycloak.util.ldap.KerberosEmbeddedServer</mainClass>
+ <classpathScope>test</classpathScope>
+ <systemProperties>
+ <systemProperty>
+ <key>ldap.ldif</key>
+ <value>kerberos-example-users.ldif</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
examples/kerberos/README.md 14(+3 -11)
diff --git a/examples/kerberos/README.md b/examples/kerberos/README.md
index c65316c..7b95993 100644
--- a/examples/kerberos/README.md
+++ b/examples/kerberos/README.md
@@ -43,21 +43,13 @@ is in your `/etc/hosts` before other records for the 127.0.0.1 host to avoid iss
for credential delegation example, as application needs to forward Kerberos ticket and authenticate with it against LDAP server.
See [this file](https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/resources/kerberos/test-krb5.conf) for inspiration.
-**6)** Run ApacheDS based Kerberos server . The [LDAP Example](../ldap) contains the embedded server, which you can run for example
-with these commands (assuming you're in `kerberos` directory with this example)
+**6)** Run ApacheDS based LDAP server. You can run the command like this (assuming you're in the "kerberos" directory with this example):
```
-cd ../ldap
-mvn clean install
-cd ..
-java -jar ldap/embedded-ldap/target/embedded-ldap.jar kerberos
+mvn exec:java -Pkerberos
```
-This will also automatically import the LDIF from `users.ldif` of kerberos example into the LDAP server. If you want to import your own LDIF file,
-you can add the system property `ldap.ldif` with the path of the LDIF file to the command. For example:
-```
-java -jar -Dldap.ldif=/tmp/my-users.ldif ldap/embedded-ldap/target/embedded-ldap.jar kerberos
-```
+This will also automatically import the LDIF from `kerberos-example-users.ldif` of kerberos example into the LDAP server. Replace with your own LDIF file if you want different users.
A bit more details about embedded Kerberos server in [testsuite README](https://github.com/keycloak/keycloak/blob/master/misc/Testsuite.md#kerberos-server).
examples/ldap/pom.xml 87(+77 -10)
diff --git a/examples/ldap/pom.xml b/examples/ldap/pom.xml
index d506efc..8081430 100644
--- a/examples/ldap/pom.xml
+++ b/examples/ldap/pom.xml
@@ -1,20 +1,87 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>keycloak-examples-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>1.4.0.Final-SNAPSHOT</version>
</parent>
- <name>Keycloak LDAP Examples - Parent</name>
- <description/>
+
<modelVersion>4.0.0</modelVersion>
+ <groupId>org.keycloak.example.demo</groupId>
+ <artifactId>keycloak-examples-ldap</artifactId>
+ <packaging>war</packaging>
+ <name>LDAP Demo Application</name>
+
+ <repositories>
+ <repository>
+ <id>jboss</id>
+ <name>jboss repo</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public/</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.keycloak</groupId>
+ <artifactId>keycloak-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.keycloak</groupId>
+ <artifactId>keycloak-util-embedded-ldap</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <artifactId>keycloak-examples-ldap-parent</artifactId>
- <packaging>pom</packaging>
+ <build>
+ <finalName>ldap-portal</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.wildfly.plugins</groupId>
+ <artifactId>wildfly-maven-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <modules>
- <module>embedded-ldap</module>
- <module>ldap-app</module>
- </modules>
+ <profiles>
+ <profile>
+ <id>ldap</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.keycloak.util.ldap.LDAPEmbeddedServer</mainClass>
+ <classpathScope>test</classpathScope>
+ <systemProperties>
+ <systemProperty>
+ <key>ldap.ldif</key>
+ <value>ldap-example-users.ldif</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
\ No newline at end of file
examples/ldap/README.md 12(+4 -8)
diff --git a/examples/ldap/README.md b/examples/ldap/README.md
index ab3c978..4ad1d5d 100644
--- a/examples/ldap/README.md
+++ b/examples/ldap/README.md
@@ -13,24 +13,20 @@ The example application is then showing all the basic claims of current user tog
Detailed steps how to make the example working:
-**1)** Build and deploy this sample's WAR file in `ldap-app/target/ldap-portal.war` . For this example, deploy on the same server that is running the Keycloak Server,
+**1)** Build and deploy this sample's WAR file in `target/ldap-portal.war` . For this example, deploy on the same server that is running the Keycloak Server,
although this is not required for real world scenarios.
**2)** Run ApacheDS based LDAP server. You can run the command like this (assuming you're in the "ldap" directory with this example):
```
-java -jar embedded-ldap/target/embedded-ldap.jar ldap
+mvn exec:java -Pldap
```
-This will also automatically import the LDIF from `ldap-app/users.ldif` into the LDAP server. If you want to import your own LDIF file,
-you can add the system property `ldap.ldif` with the path of the LDIF file to the command. For example:
-```
-java -jar -Dldap.ldif=/tmp/my-users.ldif embedded-ldap/target/embedded-ldap.jar ldap
-```
+This will also automatically import the LDIF from `ldap-example-users.ldif` into the LDAP server. Replace with your own LDIF file if you want different users.
-**3)** Run Keycloak server and import `ldap-app/ldaprealm.json` into it through admin console. This contains the realm with preconfigured LDAP federation provider and LDAP mappers
+**3)** Run Keycloak server and import `ldaprealm.json` into it through admin console. This contains the realm with preconfigured LDAP federation provider and LDAP mappers
and protocol mappers. Note that there are not any roles or users in this file. All of users, roles and role mappings data will be imported automatically from LDAP.
diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java
index 533b43f..2caed44 100755
--- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java
+++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java
@@ -56,7 +56,7 @@ public class FederationProvidersIntegrationTest {
@Override
public void config(RealmManager manager, RealmModel adminstrationRealm, RealmModel appRealm) {
- FederationTestUtils.addLocalUser(manager.getSession(), appRealm, "mary", "mary@test.com", "password-app");
+ FederationTestUtils.addLocalUser(manager.getSession(), appRealm, "marykeycloak", "mary@test.com", "password-app");
Map<String,String> ldapConfig = ldapRule.getConfig();
ldapConfig.put(LDAPConstants.SYNC_REGISTRATIONS, "true");
@@ -225,7 +225,7 @@ public class FederationProvidersIntegrationTest {
@Test
public void loginClassic() {
loginPage.open();
- loginPage.login("mary", "password-app");
+ loginPage.login("marykeycloak", "password-app");
Assert.assertEquals(AppPage.RequestType.AUTH_RESPONSE, appPage.getRequestType());
Assert.assertNotNull(oauth.getCurrentQuery().get(OAuth2Constants.CODE));
@@ -488,7 +488,7 @@ public class FederationProvidersIntegrationTest {
@Override
public void config(RealmManager manager, RealmModel adminstrationRealm, RealmModel appRealm) {
LDAPFederationProvider ldapFedProvider = FederationTestUtils.getLdapProvider(session, ldapModel);
- FederationTestUtils.addLDAPUser(ldapFedProvider, appRealm, "mary", "Mary1", "Kelly1", "mary1@email.org", null, "123");
+ FederationTestUtils.addLDAPUser(ldapFedProvider, appRealm, "marykeycloak", "Mary1", "Kelly1", "mary1@email.org", null, "123");
FederationTestUtils.addLDAPUser(ldapFedProvider, appRealm, "mary-duplicatemail", "Mary2", "Kelly2", "mary@test.com", null, "123");
}
util/embedded-ldap/pom.xml 9(+7 -2)
diff --git a/util/embedded-ldap/pom.xml b/util/embedded-ldap/pom.xml
index 6eeeece..5a1e927 100644
--- a/util/embedded-ldap/pom.xml
+++ b/util/embedded-ldap/pom.xml
@@ -28,8 +28,13 @@
<artifactId>log4j</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>