Foros de discusión

LDAP import: transform attributes (LEP-4318)

thumbnail
Martin Goldhahn, modificado hace 16 años.

LDAP import: transform attributes (LEP-4318)

Junior Member Mensajes: 34 Fecha de incorporación: 23/11/07 Mensajes recientes
Hei!
I uploaded a patch (LEP-4318) that allows LDAP attributes to be transformed before items are imported into Liferay. This could have been done with a similar mechanism as with the export (by using a custon UserImpl). But I chose a different approach:

The parameter ldap.import.user.transformer in portal-ext.properties can have a value:
[indent]<classname>:<methodname>[/indent]
in PortalLDAPUtil.importUser this method is called with the following parameters:
[indent]Long companyId, LdapContext ctx, String fullDN, Attributes attribs[/indent]

The same feature is available for user groups with a property
[indent]ldap.import.group.transformer[/indent]

This feature has a lot of potential. One could import the date of birth an other parameters into Liferay.

What do you think?

MartinG
Srijothi Vijendran, modificado hace 14 años.

RE: LDAP import: transform attributes (LEP-4318)

New Member Mensajes: 6 Fecha de incorporación: 23/06/09 Mensajes recientes
Martin,

Can you pl give me more details on this. Even i have a requirement to import address and phone number of an user from LDAP.
Should i go for writing my own class extending the com.liferay.portal.security.ldap.AttributesTransformer transformer. Any other methods that will help me?
thumbnail
Martin Goldhahn, modificado hace 14 años.

RE: LDAP import: transform attributes (LEP-4318)

Junior Member Mensajes: 34 Fecha de incorporación: 23/11/07 Mensajes recientes
When I submitted a patch for the AttributeTransformer I thought it is a good idea to plug in to Liferay's LDAP authentication and import. Having tried this approach a while and having looked at the code, I don't think this is a good idea anymore. I think the authentication should be separated from the import.

What I would do with the current version 5.2 is the following:
- disable ldap import
- create a hook plugin with an action that triggers at the login.post event
- do all the import i the action

This approach is flexible, e.g. it probably works with any new version of Liferay.

How does that sound?
Balkrushna Patel, modificado hace 10 años.

RE: LDAP import: transform attributes (LEP-4318)

New Member Mensajes: 3 Fecha de incorporación: 28/11/13 Mensajes recientes
Why u require a file for transform attributes???
Liferay provide Portal setting -> Authentication -> LDap configuration for Liferay...
U just configure a several option and add a server......
I already completed this module.....
Thanx..