|
|
Re: [EMFStore]: What do I to invoke LADPUserVerifier Class [message #1761369 is a reply to message #1761367] |
Wed, 10 May 2017 09:20 |
Edgar Mueller Messages: 17 Registered: March 2016 |
Junior Member |
|
|
Ok, here's the promised test case. In order to access the LDAP server you have to set additional properties in your es.properties file.
The test case tells you which properties you have to set, e.g. 'emfstore.accesscontrol.authentication.ldap.1.authuser' has to be set to 'cn=read-only-admin,dc=example,dc=com', 'emfstore.accesscontrol.authentication.ldap.1.authuser' to 'password' and so on, see the commented parameters in the LDAPUserVerifier constructor.
Hope this helps!
public class LDAPUserVerifierTest extends ESTestWithMockServer {
@BeforeClass
public static void beforeClass() {
startEMFStore();
}
@AfterClass
public static void afterClass() {
stopEMFStore();
}
@Test
public void ldapVerifyUser() throws AccessControlException {
final ESOrgUnitRepositoryImpl repository = new ESOrgUnitRepositoryImpl(getServerMock().getServerSpace());
final ESOrgUnitProvider orgUnitProvider = new ESOrgUnitProviderImpl(repository);
final LDAPUserVerifier ldapVerifier = new LDAPUserVerifier(
orgUnitProvider,
"ldap://ldap.forumsys.com", // url
"dc=example,dc=com", // base
"uid", // searchdn
"cn=read-only-admin,dc=example,dc=com", // authuser
"password"); // authpass
assertTrue(ldapVerifier.verifyPassword("gauss", "password"));
}
}
--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
--
Edgar Mueller
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03895 seconds