掲示板

Mapping LDAP user data to Liferay user data

thumbnail
15年前 に Timm Wimmers によって更新されました。

Mapping LDAP user data to Liferay user data

New Member 投稿: 16 参加年月日: 09/03/25 最新の投稿
Hello,

we've installed Liferay successfully and bind authentification to LDAP. Now we want to fill the data for liferay users (i.e. street, city, zipcode, birthday, telephone etc.) with data from LDAP - how con that be done?

Thank you.

--
Timm
thumbnail
15年前 に Samuel Kong によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
Liferay currently only syncs a user's screen name, password, email, name, and job title. If you want to sync additional properties, you'll need to modify PortalLDAPUtil
thumbnail
14年前 に Jignesh R Vachhani によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
hey samuel,

have you done this anytime?

If you have done please provide more information on that

Thanks
14年前 に vikas suresh thakre によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Junior Member 投稿: 97 参加年月日: 09/05/18 最新の投稿
Hi all,
I also have same requirment. I want to import user information other than the five field which are by default get imported.
like i want to store user's phone No, address etc from the LDAP Directory.
If anybody has done this pls provide some information about that.
any help here is appreciable.
thumbnail
14年前 に Jignesh R Vachhani によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
Hi Vikas,

I have successfully done this task you can integrate any fields as you want.

For that you cant use Liferay setting GUI you have to make setting in your portal-ext.properties file.

You have to add fields over there and you have to map these all fields into you portalldaputil.java class.
14年前 に vikas suresh thakre によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Junior Member 投稿: 97 参加年月日: 09/05/18 最新の投稿
Hi Jignesh,
Thanks for replying
can u please tell me the Exact steps to add other user attributes in to the database like mobile number i have to insert in to the
phone table, city , street i have to enter in to the address table.
so tell me where should i write this code so that it will update these table for each user.
if u have done that pls tell me the steps to modify the code..
thanks
thumbnail
14年前 に Jignesh R Vachhani によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
Hi Vikas,

Follow these steps:

1.Make ready your LDAP server with your fields with proper schema.
2.change portal-ext.properties ldap.user.mappings=screenName=cn\npassword=userPassword\nemailAddress=mail\nfirstName=givenName\nlastName=sn\njobTitle=title\nlocation=location\ndescription=description\npractice=practice\nphone=telephoneNumber\nbirthDate=birthDate\ndepartment=department\ncontactPerson=contactPersonName\nuserType=userType\ngroup=groupMembership\njoiningDate=joiningDate as per your requirement .
3.create your own service with these fields
4. call add method from your service into portalldaputil.java

and restart your server so it will automatically take fields from ldap and populate your table.
You can also refer this article
14年前 に Daniel Paschke によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 11 参加年月日: 09/11/25 最新の投稿
Hello Jignesh,

can you please tell me how to create a service? and what to define there?

I got a similar problem then the one above:

I need to map usergroups from a specific ldap attribute called "employeeType" but my ldap-server does not have any groupsDN, so ldap fails to import a users employeeType-attribute to the liferay-group because there is no groupDN ...

i know that there was a similar patch in

http://issues.liferay.com/browse/LEP-3915

but this one is for liferay 4.x and im using 5.2 now.. and i just want to know if it is possible to achieve a simple group mapping (without looking into ldap-groups) without touching the liferay sources (by doin it in extension environment)

I hope i made myself clear enough
thumbnail
14年前 に Jignesh Vachhani によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
If you have created your own attribute then you need to define this in portal-ext.properties file and according to that you have to fetch that attribute in portalldaputil.java class.
thumbnail
14年前 に Timm Wimmers によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 16 参加年月日: 09/03/25 最新の投稿
Hello Jignesh,

how exactly did you do that?
Can you please share the LDAP parts of your portal-ext.properties and the modifications on the java file?

I'm not a java programmer, but will give it a try if I can get a good starting point in this example.

Thank you,
Timm
14年前 に praveen kumar によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 4 参加年月日: 09/12/29 最新の投稿
Hi Timm,

For instance if you have added an new or modified ldap properties in your ext.properties

e.g : ldap.base.provider.url=ldap://127.0.0.1:1389

modified ldap_new.base.provider.url=ldap://127.0.0.1:1389

in order to reflect these changes you should also modify/add your properties

1. In PropsKeys.java
2. In PropsValues.java

and modify PortalLDAPUtil.java by extending it in Ext environment.


Praveen.
14年前 に vikas suresh thakre によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Junior Member 投稿: 97 参加年月日: 09/05/18 最新の投稿
Hi Guys, if your are using liferay 5.2 version then there is not need to change the code for custom attribute. from control pannel you can create your own custom attribute for the user.

Thanks
Vikas Thakre.
thumbnail
14年前 に Jignesh Vachhani によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
Hi Timm,

I already mentioned the steps in my previous post in the same thread.
14年前 に Ryan Ward によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 18 参加年月日: 10/02/12 最新の投稿
Do you still need to edit the Java files in 5.2? (I assume you do) I see where I can add custom classes via the GUI.
11年前 に Chuck Wyatt によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 10 参加年月日: 11/10/17 最新の投稿
Hi Daniel,

I'm wondering if you eventually had success with this? We're in Liferay 6.1.1 CE GA2. We have LDAP user attributes that we'd like to use as an indication of in what Liferay group a user has membership. This sounds similar to the issue you had? Like you I found this old patch for 4.x but that doesn't apply now and wondering the best way to map groups membership based on the values of LDAP user attributes.

Thanks,

Chuck
thumbnail
13年前 に Marco Paul Timbi Ulloa によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 5 参加年月日: 10/12/13 最新の投稿
I have the version 6.0.5, try to use the custom ldap mapping, but don't work, how use the parameters??

I have the next lines in portal-ext.properties

ldap.user.custom.mappings=uid=Identificacion, where uid is my attribute in LDAP and Identificacion is the custom user field in Liferay.

But this don't work
thumbnail
13年前 に Shagul Khajamohideen によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 758 参加年月日: 07/09/27 最新の投稿
Try the below. You need to change the order (customattribute=LDAPAttribute).

ldap.user.custom.mappings=Identificacion=uid

Also any changes to this property after the initial LDAP setup does not reload from properties file. To force a load, you could delete the existing LDAP setup from control panel and create a new one. This forces the settings to be read from portal-ext.properties file which then gets persisted to the database.

Since the properties file is the only out of the box way to change these settings, I think these properties (the ones that cannot be changed from control panel) should be read from the file on startup.
thumbnail
13年前 に Marco Paul Timbi Ulloa によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 5 参加年月日: 10/12/13 最新の投稿
My ldap parameter is uid and my Liferay Parameter is Identificacion, I deactive the accounts and delete the accounts, restart the service and nothing... The parameter in in portal-ext.properties or portal-developer.properties
thumbnail
13年前 に Shagul Khajamohideen によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 758 参加年月日: 07/09/27 最新の投稿
Hi Marco,

Try flipping the order. Liferay custom field comes on the left.

Best,
Shagul
thumbnail
13年前 に Marco Paul Timbi Ulloa によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 5 参加年月日: 10/12/13 最新の投稿
Hello my Friend I try but nothing!!! I have the version 6.0.5.

The rest of process with ldap work excellent, but need custom fields for Additional Information.

Another solution???
thumbnail
13年前 に Shagul Khajamohideen によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 758 参加年月日: 07/09/27 最新の投稿
Hi Marco,

Did you create the custom fields through the control panel for the user object? I am running LR 6.0 EE with a whole bunch of custom fields without any issues.
13年前 に Fernando Cevallos によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 3 参加年月日: 10/10/11 最新の投稿
I had the same problem!! Can some one help me??
13年前 に Fernando Cevallos によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 3 参加年月日: 10/10/11 最新の投稿
Is there a solution for LR 6.0 CE??
12年前 に Mourad EF によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 21 参加年月日: 11/02/12 最新の投稿
Hi,
Dis you successed to map Ldap photo to LR photo ?
I'm trying to do the same (with phone number also)
thanks
12年前 に paurik bhavsar によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 21 参加年月日: 11/04/22 最新の投稿
try this in your jsp
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:10389");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
env.put(Context.SECURITY_CREDENTIALS, "secret");
env.put("java.naming.ldap.typesOnly", "true");
DirContext ctx = null;
NamingEnumeration results = null;
// Indicate that we only want the type names


try {

// Create initial context
ctx = new InitialDirContext(env);
// Get the attributes
Attributes attrs = ctx.getAttributes("cn=test,ou=system");
Attribute attr1 = attrs.get("telephoneNumber");

// Print the answer
System.out.println(attrs);
// Close the context when we're done
ctx.close();
} catch (NamingException e) {
e.printStackTrace();
}
12年前 に Mourad EF によって更新されました。

RE: Mapping LDAP user data to Liferay user data

New Member 投稿: 21 参加年月日: 11/02/12 最新の投稿
thank you for your reply .

I've done this using EXT environment, by modifying (extending) PortalLDAPImporterImpl.java
thanks to this post:
import phones from ldap

It works well for organization and telephoneNumber ... if you want more information tell me

Photos are not supported by LDAP (as far as i know), so I think i'm going to use your method to import photos from a directory in the server or something like that ... thanks

Mourad
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Mourad EF:
Hi,
Dis you successed to map Ldap photo to LR photo ?
I'm trying to do the same (with phone number also)
thanks


In Liferay 6.1 now you can map LDAP portrait with user portrait. Just use "portrait" in portal-ext.properties (LDAP user mappings section).
thumbnail
11年前 に Jignesh Vachhani によって更新されました。

RE: Mapping LDAP user data to Liferay user data

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
Yes right juan
Now in LR 6.1 its very easy to configure