我在Windows 7上安装了LDAP-Apache Directory Studio。请为我在LDAP 上创建的两个用户找到屏幕截图。我想用LDAP服务器验证LDAP登录模块。我创建了一个用户,但我无法在我的worklight应用程序描述符上正确配置它。我已经关注了IBM官方网站提供的文档,但仍然有些我无法做到这一点。我试过跟随xml数据:
<loginModule name="LDAPLoginModule">
<className>com.worklight.core.auth.ext.LdapLoginModule</className>
<parameter name="ldapProviderUrl" value="ldap://127.0.0.1:10389"/>
<parameter name="ldapTimeoutMs" value="5000"/>
<parameter name="ldapSecurityAuthentication" value="simple"/>
<parameter name="validationType" value="searchPattern"/>
<parameter name="ldapSecurityPrincipalPattern" value="uid=localadmin,ou=users,ou=system,dc=example,dc=com"/>
<parameter name="ldapSearchFilterPattern" value="(&(uid={username})(objectclass=inetOrgPerson)"/>
<parameter name="ldapSearchBase" value="dc=example,dc=com"/>
</loginModule>
我对LDAP知之甚少,所以我坚持使用它。
---------------------------------更新了Kayyagari的soln --------- -------------------
我已根据你的建议尝试过,但我现在得到一个不同的错误,我已经发布了相同的日志,你能帮我吗
Worklight Console Logs
[AUDIT ] CWWKG0016I: Starting server configuration update.
[AUDIT ] CWWKG0017I: The server configuration was successfully updated in 0.010 seconds.
[AUDIT ] CWWKT0017I: Web application removed (default_host): http://INFAR20658.nmumarl.lntinfotech.com:10080/module_23_2_LDAPLoginModule/
[AUDIT ] CWWKZ0009I: The application LDAPLoginModuleProject has stopped successfully.
[AUDIT ] CWWKG0016I: Starting server configuration update.
[AUDIT ] CWWKG0017I: The server configuration was successfully updated in 0.028 seconds.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://INFAR20658.nmumarl.lntinfotech.com:10080/module_23_2_LDAPLoginModule/
[WARNING ] Using empty value for configuration property 'ssl.keystore.path'
[WARNING ] Using empty value for configuration property 'ssl.keystore.password'
[AUDIT ] CWWKZ0001I: Application LDAPLoginModuleProject started in 1.707 seconds.
[WARNING ] FWLSE0138W: LdapLoginModule authentication failed. Reason 'java.lang.Exception: searchPattern
at com.worklight.core.auth.ext.LdapLoginModule.login(LdapLoginModule.java:162)
at com.worklight.core.auth.impl.LoginContext.invokeLoginModule(LoginContext.java:236)
at com.worklight.core.auth.impl.LoginContext.processRequest(LoginContext.java:200)
at com.worklight.core.auth.impl.AuthenticationContext.processRequest(AuthenticationContext.java:274)
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:148)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:85)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:949)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1029)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4499)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:282)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:954)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:252)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:584)
at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:439)
at com.ibm.ws.threading.internal.Worker.run(Worker.java:421)
at java.lang.Thread.run(Unknown Source)
答案 0 :(得分:2)
您的用户位于ou = system下,因此请更改“ldapSecurityPrincipalPattern”和“ldapSearchBase”的值,如下所示
<parameter name="ldapSecurityPrincipalPattern" value="uid=localadmin,ou=users,ou=system"/>
<parameter name="ldapSearchBase" value="ou=system"/>