ldap,liferay,liferay-6,liferay-ide , Cannot login using ldap user in Liferay

Cannot login using ldap user in Liferay


Tag: ldap,liferay,liferay-6,liferay-ide

It was working until few days back but right now it doesnt login in.It shows authentication failed please try again.Im using Liferay 6.2 and this is my portal-ext.properties





ldap.base.provider.url= ldap://localhost:389
ldap.base.dn= dc=echolaide,dc=schoolx
ldap.security.principal= cn=admin
ldap.security.credentials= x1234#

ldap.users.dn= dc=echolaide,dc=schoolx
ldap.groups.dn= dc=echolaide,dc=schoolx






ldap.auth.search.filter=([email protected][email protected])



I tested the ldap connection,user and groups from the control panel. They all are fine.I could see the user i tried to login.But im not able to login using the user.Can any one help me to identify the issue?


16:07:01,799 ERROR [liferay/scheduler_dispatch-4][PortalLDAPImporterImpl:1061] Unable to load user {createtimestamp=createTimestamp: 20150209095349Z, mail=mail: [email protected], userpassword=userPassword: [[email protected], creatorsname=creatorsName: cn=Directory Manager,cn=Root DNs,cn=config, givenname=givenName: raman, sn=sn: raman, cn=cn: raman raman}
    at com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:6158)
    at com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:5897)
    at com.liferay.portal.service.impl.UserLocalServiceImpl.addUserWithWorkflow(UserLocalServiceImpl.java:746)
    at com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:608)
    at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
    at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
    at com.sun.proxy.$Proxy106.addUser(Unknown Source)
    at com.liferay.portal.service.UserLocalServiceUtil.addUser(UserLocalServiceUtil.java:1166)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.addUser(PortalLDAPImporterImpl.java:521)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importUser(PortalLDAPImporterImpl.java:930)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importUsers(PortalLDAPImporterImpl.java:1042)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAPByGroup(PortalLDAPImporterImpl.java:664)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:197)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:139)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:101)
    at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:39)
    at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.doReceive(LDAPImportMessageListener.java:51)
    at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
    at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
    at com.sun.proxy.$Proxy297.receive(Unknown Source)
    at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:76)
    at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
    at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
    at java.lang.Thread.run(Thread.java:745)


The exception says the userScreenName has issue. The LDAP attribute which is mapped to Liferay screenName has value which is rejected by Liferay. If it has some special characters, you can set "allowed special characters" using a property in portal-ext.properties file.


Web2py - Howto Auto Convert Username field to uppercase

I am looking to have all users that sign in have their name converted(Transformed) to uppercase in the DB records or before it hits the DB. Currently I am using LDAP. So people are free to use sign ins like this: ['PREACTIVE','Preactive','preactive','PREactive','preACTIVE'] Each one of those will get a new...

Cons of a liferay cms while website development using Community Edition

I am new to LIFERAY CMS. i need cons of a liferay cms i.e., difficulties faced while developing and using liferay cms. can you please list cons of liferay cms.

I am working on a MVC Portlet and the document i am saving is not going to db

Here is my Action Class, where I have to save any document to database but its not working and getting error in console that NoSuchMethodException (javax.portlet.ActionRequest, javax.portlet.ActionResponse) package com.test.docupload; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import javax.portlet.ResourceRequest; import javax.portlet.ResourceResponse; import javax.portlet.PortletException; import com.liferay.counter.service.CounterLocalServiceUtil; import...

commandButton action method not invoked in Liferay

I've the below portlet view.xhtml: <?xml version="1.0"?> <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:body> <h:form> <h:commandButton value="TESTButton" action="#{navigationViewBean.submit}" /> <h:outputText value="TESTGetter: #{navigationViewBean.testField}" /> </h:form>...

How can I change the zIndex attribute of aui-datepicker in Liferay Portlet 6.2

I have discoveder one problem with date field in portlet in LF 6.2. The problem is that after clicking on the input field, the datepicker is displaying, but with zIndex=0, that means it is under the portlet. If I change on firebug that parameter to 1, everything is OK. I...

Incorrect liferay-plugins dependency

In https://github.com/liferay/liferay-plugins/blob/6.2.x/build-plugins.gradle#L9 following dependency is defined: dependencies { classpath group: "com.liferay.portal", name: "portal-service", version: "7.0.0-SNAPSHOT" } How can a 6.2.x version have a dependency on 7.0.0 version? Is it a bug? When I peek to the history of the file, the dependency has always been there. I am not able...

Gitlab LDAP (Active Directory) Authentication without Server Side Access

I am using GitLab Omnibus 7.10.0 on RHEL 6.6. I have enabled LDAP using the following configuration: gitlab_rails['ldap_enabled'] = true gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below main: # 'main' is the GitLab 'provider ID' of this LDAP server label: 'FOO COM Active Directory...

JNDI SPI provider for LDAP (Apache DS)

I was trying to implement a program to do JNDI lookup for LDAP. I saw there is open source LDAP from Apache viz: apacheds-2.0.0-M20 The below is the program that i wrote: import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingException; import javax.naming.ldap.InitialLdapContext; import javax.naming.ldap.LdapContext; import javax.naming.directory.InitialDirContext; class JndiLDAPLookup { public static void...

LDAP More than one negation operators in filter

I try to write a LDAP filter with two negations. I need all users who are not disabled AND don't belong to OU=Abt99 . This is my filter at the moment: (&(objectClass=user)(objectCategory=person)(samaccountname={USERNAME})(!(userAccountControl:1.2.840.113556.1.4.803:=2))) I tried (&(objectClass=user)(objectCategory=person)(samaccountname={USERNAME})(!(userAccountControl:1.2.840.113556.1.4.803:=2)(OU=Abt99))) and...

Configuring a Custom LDAP Authentication Provider with Spring Security

I'm trying to configure the Spring Security with LDAP Authentication, but I need to get the username for all login requests. I configure my spring-security.xml who points to my MyCustomAuthenticationProvider class. I think the configuration is correct, but in runtime, the Spring first try to login with his own LdapAuthenticationProvider....

How to pass HTTP request to Web-Service

From my portlet JSP, I am trying to make a Ajax call to web-service. My aim is to pass HTTP request object as a parameter to web-service method. Please suggest.

Include ftl file in ext plugin

I have ext-plugin and I would like to override this file: portal-impl\src\com\liferay\portlet\dynamicdatamapping\dependencies\ddm\documentlibrary.ftl. After maven build, this file isn't include in my porta-impl-ext.jar. In my portal-impl-ext's pom.xml I have this code: <build> <plugins> <plugin> <groupId>com.liferay.maven.plugins</groupId> <artifactId>liferay-maven-plugin</artifactId> <version>${liferay.maven.plugin.version}</version> <configuration>...

SonarQube LDAP authentication is not working

Presently, connecting to Apache Directory Server 2.0 from SonarQube 5.0.1. Have given the following entries in sonar.properties file: # LDAP configuration # General Configuration sonar.security.realm=LDAP sonar.security.savePassword=false ldap.url=ldap:// # User Configuration ldap.user.baseDn=o=TechMahindra ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login})) ldap.user.realNameAttribute=cn ldap.user.emailAttribute=mail # Group Configuration...

Form submit portlet with Spring MVC

I'm trying to achieve a Liferay portlet of submit form using spring MVC. The model: package com.model; public class Person { String firstName; String middleName; public String getFirstName() { return this.firstName; } public String getMiddleName() { return this.middleName; } public void setFirstName(String firstName) { this.firstName=firstName; } public void setMiddleName(String middleName)...

Add user to LDAP using JAVA. Naming.InvalidNameException: Invalid Name

I am practicing in Java, adding a user to LDAP(v3, running on my Virtual machine). Userdetails and attributes are obtained from postgres database running locally. This is my code (may not be a good approach): public class LDAPConnector { static final String DOMAIN_URL = "ldaps://"; static final String ADMIN_NAME =...

Get list of users in liferay

I want to display users list on liferay. and I am having problem with it. Here is my action class. public void userList(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException { // Todo Logic for user code try { int countUser = UserLocalServiceUtil.getUsersCount(); log.info("User Present In DB" + countUser); List < User...

LDAP Access - javax.naming.CommunicationException: simple bind failed

We are running into issues connecting LDAP server after LDAP SHA-256 Migration .We got the below exception when we ran our application in debug mode : javax.naming.CommunicationException: simple bind failed: xxxamd.xxx.com:636 [Root exception is java.net.SocketException: Socket is closed]​ We tried to add the below .cer files into our application specific...

How can I retrieve deleted objects from Active Directory with Ruby?

From the research I've done, it appears I need to send a special OID with my request (1.2.840.113556.1.4.417) in order to access the Deleted Objects container. I couldn't find a way to send a specific control with a request using the "net-ldap" gem. Does anyone know if this is possible?...

Active Directory Integration Plugin

I'm trying to integrate my Active directory to my website. So, I downloaded the AD Integration Plugin, but it says "ATTENTION: You have no LDAP support. This plugin won´t work. You must install or enable LDAP support in PHP." How do I fix that? Is that a php problem? Thanks...

Customizing liferay Calendar portlet

I'm trying to customize Calendar portlet using this below instructions. https://www.liferay.com/it/documentation/liferay-portal/6.2/development/-/ai/creating-plugins-to-extend-plugins-liferay-portal-6-2-dev-guide-03-en Its basically creating Plugins to extend plugins. In order to achieve above, I need "Calendar-portlet.war" . I don't find any war file for calendar portlet for my version. So i decided to build myself. Then i downloaded Portal plugins...

How to implement Spring Security Ldap authentication using the configurer class correctly?

Hi I'm trying to implement spring's ldap authentication using the WebSecurityConfigurerAdapter class. So far I can authenticate through the in memory method and even my corp's ldap server, however the latter method I'm only able to authenticate if I pass a hardcoded userDN and password when I create the new...

How to upload file in relative directory

I have made a application where we can upload any file which will save in our local given directory. I want to modify it, i want to add a drop down (with multiple option i.e floor, store, section) for department. i.e if we want to upload a file in 'Store'...

Service builder doesn't delete table in DB

Hi all, I'm using LR 6.1. I created a new entity Called " Recommendation" in service.xml then a run BuildServices with Ant to generate the service builder Files. Now I want to delete the Entity. So I Deleted if from service.xml, but nothing happens in Data base and the other...

Active Directory membership provider using LDAP

I am working on a school assignment where we handle logins to a web application written in asp.NET using Active Directory. Our Active Directory is installed on a virtual machine on Azure. When trying to login, I am presented with the following error: I have checked my connection string multiple...

Customizing My Sites portlet in Liferay

I want to customize My Sites portlet (which is out of box portlet) in liferay using ext. How do I do this? How do I get the source code for the my sites portlet?

How can I configure AOP in Liferay Service Builder?

I want to to intercept a method in Service Builder, for example: XXXLocalService.update(). But I don't know the correct way to do this. I have done some research but I haven't found a clear way to do this. Any help will be greatly appreciated....

AuthenticationException LDAP using plain Java

i have a problem while connecting to an Active Directory via ldap using plain Java. If the displayName begins with a , (Comma e.g. ", name") I get a javax.naming.AuthenticationException. The displayName is never used in the application. Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS wich I use dont contain any commas. Can somebody...

Spring LDAP Context.REFERRAL to follow

How do I set the LDAP Context.REFERRAL to follow in a Spring Security configuration? This is related to a problem I already reported and for which I found an unsatisfactory solution before discovering the real solution I am seeking for involve setting this environment attribute in the LDAP context to...

How to ignore Liferay user removed from LDAP errors?

I have a Liferay 6.1 instance that is connected to LDAP. New users get imported nicely, but when I remove a user from the LDAP directory, Liferay starts throwing exceptions when it tries to sync users from LDAP. These seem to be safe to ignore, but they produce several megabytes...

How manage styles in Vaadin portlet in Liferay

I have a Portlet, where is used Valo theme. Most graphical components are displayed properly, but TextField not. It should have rounded border radius and height should be about 35px. It has normally about 15px and the field is angular. When I narrow width of browser window to about 200px...

How to create service builder for liferay plugin project with maven

I have Already create Liferay Plugin project. and maven install also over. it gives ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] --------------------------------------------------------------------- [INFO] Total time: 1:29.773s [INFO] Finished at: Wed Jun 17 15:46:10 IST 2015 [INFO] Final Memory: 34M/151M [INFO] -----------------------------. But unable to add service builder. When i try to add...

Spring-LDAP - Password Compare How-to Update Failed Password Attempts

Using ApacheDS 2.0.0, the pertinent portion of the config is: dn: ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config ads-pwdminlength: 5 ads-pwdinhistory: 5 ads-pwdid: default ads-pwdcheckquality: 1 ads-pwdlockout: TRUE ads-pwdlockoutduration: 0 ads-pwdvalidator: org.apache.directory.server.core.api.authn.ppolicy.DefaultPasswordValidator ads-pwdmaxfailure: 5 ads-pwdattribute: userPassword ads-pwdfailurecountinterval: 30 entryParentId:...

How to pass data from page to Portlet class through AJAX call?

I'm trying to pass a value in an AJAX 'GET' request to my Portlet class, but I can't quite figure out a way to access such variable's value in the class. My AJAX code is: function loadXMLDoc() { var nocache = new Date().getTime(); var xmlhttp=new XMLHttpRequest(); var url = "${mURL}";...

Avoiding Active Directory Uniqueness Constraint Violation During Rename

Our environment has 2 Windows domain controllers successfully replicating on W2k12. In that domain, like everyone else, we have tons of accounts, some of whose account attributes are required to be unique. For business reasons not worth visiting here, we need to sometimes swap attributes between accounts. That is, user1...

Error while importing LDIF

Server: Apache DS 2.0 Client: Apache Directory Studio 2.0 The problem: I am running into error while importing a LDIF This one works http://pastebin.com/DKZ4fT0U This one does not http://pastebin.com/Z5NxUxX4 Error message: #!ERROR [LDAP: error code 32 - NO_SUCH_OBJECT: failed for MessageType : ADD_REQUEST Message ID : 81 Add Request :...

how to bypass the necessity of having to have email address firstname and lastname in liferay to import authenticating users

My application uses liferay to connect to LDAP server and import authenticating users. But many of the user records in the ldap schema doesn't have email id. This seems to be preventing me from importing these users as liferay requires email id, among other things, inorder to successfully import new...

ldapadd gives “no global superior knowledge” on default config

Background: I'm installing a Prosody XMPP server and Kaiwa webclient on a DigitalOcean droplet. Kaiwa has a one-click deploy-to-DO-droplet tool using Docker that I tried first, but it didn't work - probably because I'm using the 512MB minimum DO VPS and it ran out of memory with half of the...

In liferay market place, I am unable to submit the project

In Liferay market place i am stuck at the place "Upload Liferay Plugin Packages " When ever i am trying to upload a war file Please help me to short it out :)...

Can't get LDAP department

After bind user try to get department list: $filter = "(department=*)"; $justthese = array("*"); $sr = ldap_search($ldap_conn, $ldap_dn, $filter, $justthese); $info = ldap_get_entries($ldap_conn, $sr); for($i=0; $i < $info["count"]; $i++) { echo "department: " . $info[$i]["department"][0]."<br>"; } get blank window...

Difference between Liferay Mobile SDK and Liferay Screens

Can someone tell me the difference between Liferay Mobile SDK and Liferay Screens? Thanks a lot....

AJAX Call not working in liferay 6.2.2?

I am trying to perform a AJAX Call. But what i get is ResourceURL as undefined when i see the error in chrome. Below is my code. Declaration: <liferay-portlet:resourceURL copyCurrentRenderParameters="<%= false %>" var="mainURL" /> Implementation: xhr2.open("POST", resourceURL , false); But at implmentation i get resourceURL as undefined. In 6.1 it...

Lifefay freemarker ADT: methods unavailable?

I'm trying to work on some ADT for asset publisher (Documents and Media type), but I often have a message telling me that : Expression assetRenderer.getDataRepositoryId is undefined or Expression assetRenderer.getFileEntryId is undefined I found some threads where people said that we must add velocity.engine.restricted.classes= velocity.engine.restricted.variables= freemarker.engine.restricted.classes= freemarker.engine.restricted.variables= in portal-ext.properties...

Bash How To Select Multiple Lines from ldif-type File based on dn

I am wondering how best to parse an ldif file (and ldif-like files) so that I can import each DN entry and its associated attributes into variables, without crossing over into other DNs and their attributes, as everything is in a single file. Please how can this be done? Thanks...

How to set multiple LDAP object classes with PHP?

I'm trying to receive user data from an Shibboleth/SAML IdP and pass it into an LDAP: // Get data from IdP $attributes = getUserFromIdP(); // Connect + bind (simplified) $ldapconn = ldap_connect(); ldap_bind(); // Prepare data $info['uid'] = $attributes['uid'][0]; $info['givenName'] = $attributes['givenName'][0]; $info['sn'] = $attributes['sn'][0]; $info['cn'] = $attributes['cn'][0]; $info['mail'] =...

Riak CS LDAP authentication

I read here that Riak CS supports LDAP for authentication: http://bit.ly/1Rb2yTF "Pluggable Authentication/Authorization for Integration with Existing Infrastructure – Riak CS provides an extensible authentication system, enabling integration with existing directory services (LDAP, ActiveDirectory, NIS, PAM)." However I cannot find anything relating to the LDAP authentication configuration in the docs....

Users in Guest role see default theme instead custom one for given layouts

Users in Guest role see default theme instead custom one for pages which inherit from defined custom theme. This seems to be very strange problem. Even though layouts have specified to inherit theme from parent theme: Use the same look and feel of the Public Pages. Guests see them as...

Design Pattern to only return certain LDAP attributes in an object

Let's say I have the following class, with many instance variables and corresponding getters and setters: public class Foo { private String a; private int b; ... private List<String> z; public String getA() { return a; } public void setA(String a) { this.a = a; } public int getB() {...

LDAP connection only works on localhost

I have a login page that verifies credentials with active directory and redirects to the next page. When I run it locally it works perfect, but when I put it out on our webserver it gives an error trying to create the group principal: (System.DirectoryServices.DirectoryServicesCOMException (0x80072020)) I need to find...