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

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


Tag: ldap,liferay

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 user records. I am wondering if my above assertion is entirely correct. If it is, then is there a way to bypass this, so that I can import any user with objectclass: inetOrgPerson and has the attributes cn and userPassword

Please correct me if I am wrong in any of these, and please provide with a solution if there is one.


It won't be easy to remove Liferay's dependency on users having a unique email address - it might be easier to set them up with an artificial email address in order to import them.

In case you stumble upon this artificial email address in Liferay's UI and don't like it, you can always update the UI and hide the mail address there.

Another option is to update your terms&conditions and require every user to have an email address - e.g. for contacting them in order to reset their password in case they ever forget it.

But, as the meat of your question is to remove the need for an email address per user: There's not a simple switch. I'd advise against modifying this quite central assumption. You can do it, but it won't be pretty and probably not well maintainable (just think about the various "subscribe" options all over the many components that Liferay comes with)


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}";...

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...

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 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....

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>...

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 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...

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...

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 :...

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...

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 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...

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...

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...

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...

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...

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...

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...

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 :)...

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...

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...

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...

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...

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....

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...

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 =...

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...

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...

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 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'...

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...

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 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'] =...

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...

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.

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...

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.

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...

Difference between Liferay Mobile SDK and Liferay Screens

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

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>...

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...

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...

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)...

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() {...

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...

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...