The problem file is org.picketlink.internal.SecuredIdentityManager.java in picketlink-impl-2.7.0.Final.jar. Simply looking at line 72 in that file will show that it calls itself as shown in the code snippet above.
My workaround was to just call lookupIdentityById() on the IdentityManager instead of lookupById()
So here is the security configuration behind my unit tests
public class SecurityConfiguration {
|
|
// -----------------------------------------------------------------------------
|
// Static Variables and Methods
|
// -----------------------------------------------------------------------------
|
private static final String LDAP_URL = "ldap://...:389";
|
private static final String BASE_DN = "DC=...,DC=net,DC=au";
|
private static final String BIND_DN = "...";
|
private static final String BIND_CREDENTIALS = "...";
|
private static final String USER_SEARCH_DN = "...";
|
|
// -----------------------------------------------------------------------------
|
// Constructors and life-cycle methods
|
// -----------------------------------------------------------------------------
|
@SuppressWarnings("unused")
|
private void configureIdentityManager(@Observes final SecurityConfigurationEvent event) {
|
|
final SecurityConfigurationBuilder builder = event.getBuilder();
|
|
System.setProperty("com.sun.jndi.ldap.connect.pool.authentication", "simple");
|
System.setProperty("com.sun.jndi.ldap.connect.pool.maxsize", "10");
|
System.setProperty("com.sun.jndi.ldap.connect.pool.prefsize", "5");
|
System.setProperty("com.sun.jndi.ldap.connect.pool.timeout", "300000");
|
System.setProperty("com.sun.jndi.ldap.connect.pool.debug", "all");
|
|
final Properties properties = new Properties();
|
|
// ldap properties
|
properties.put("com.sun.jndi.ldap.connect.pool", "true");
|
|
// ldap properties
|
builder.idmConfig()
|
.named("default")
|
.stores()
|
.ldap()
|
.activeDirectory(true)
|
.connectionProperties(properties)
|
.baseDN(BASE_DN)
|
.bindDN(BIND_DN)
|
.bindCredential(BIND_CREDENTIALS)
|
.url(LDAP_URL)
|
.supportCredentials(true)
|
.mapping(User.class)
|
.baseDN(USER_SEARCH_DN)
|
.objectClasses(
|
"user",
|
"person",
|
"organizationalPerson")
|
.attribute("loginName", "sAMAccountName", true)
|
.attribute("name", CN)
|
.attribute("email", EMAIL);
|
}
|
}
|
And the pom.xml contains the following
|
<properties>
|
...
|
<!-- Security -->
|
<picketlink.version>2.7.0.Final</picketlink.version>
|
<picketbox.ldap.version>1.0.2.Final</picketbox.ldap.version>
|
...
|
</properties>
|
|
<dependencyManagement>
|
<dependencies>
|
...
|
<!-- Dependency Management for PicketLink and Java EE 6.0. -->
|
<dependency>
|
<groupId>org.picketlink</groupId>
|
<artifactId>picketlink-javaee-6.0</artifactId>
|
<version>${picketlink.version}</version>
|
<scope>import</scope>
|
<type>pom</type>
|
</dependency>
|
|
<dependency>
|
<groupId>org.picketbox</groupId>
|
<artifactId>picketbox-ldap</artifactId>
|
<version>${picketbox.ldap.version}</version>
|
<scope>compile</scope>
|
</dependency>
|
|
<dependency>
|
<groupId>org.picketbox</groupId>
|
<artifactId>picketbox-ldap</artifactId>
|
<version>${picketbox.ldap.version}</version>
|
<type>test-jar</type>
|
<scope>test</scope>
|
</dependency>
|
...
|
</dependencies>
|
</dependencyManagement>
|
|
<dependencies>
|
....
|
<dependency>
|
<groupId>org.picketlink</groupId>
|
<artifactId>picketlink-api</artifactId>
|
<version>${picketlink.version}</version>
|
</dependency>
|
<dependency>
|
<groupId>org.picketlink</groupId>
|
<artifactId>picketlink-impl</artifactId>
|
<version>${picketlink.version}</version>
|
<scope>runtime</scope>
|
</dependency>
|
...
|
</dependencies>
|
...
|
|