[EMFStore]: What do I to invoke LADPUserVerifier Class [message #1761218] |
Tue, 09 May 2017 03:12  |
Eclipse User |
|
|
|
Hello Maximilan and Edgar,
I want to use LADP. In es.propeties file I put:
emfstore.accesscontrol.authentication.policy=ldap
...
emfstore.accesscontrol.authentication.ldap.1.url=LDAP://ldap.forumsys.com:389/
emfstore.accesscontrol.authentication.ldap.1.base=ou=mathematicians,dc=example,dc=com
When I do debug. I see that invoke to UserVerifierChain.
My question is: What do I do to use LDAPUserVerifier Class.
Many thanks advanced.
Amalia
|
|
|
|
Re: [EMFStore]: What do I to invoke LADPUserVerifier Class [message #1761369 is a reply to message #1761367] |
Wed, 10 May 2017 05:20   |
Eclipse User |
|
|
|
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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.06127 seconds