留言板

LDAP query for map prefix of email address to liferay screen name

karthik N,修改在12 年前。

LDAP query for map prefix of email address to liferay screen name

Regular Member 帖子: 106 加入日期: 11-7-1 最近的帖子
Hi,
Is der any possiblity in Liferay LDAP configuration to map ldap user's prefix of the Email Address to Liferay screen name
For example,
Email Address is karthik@liferay.com
the first part(upto @) karthik need to be mapped to liferay screen name


thanks in advance


Regards,
Karthik
thumbnail
Thiago Leão Moreira,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Liferay Legend 帖子: 1449 加入日期: 07-10-10 最近的帖子
You should developed a class that implement this interface com.liferay.portal.security.ldap.AttributesTransformer and configure it on your portal-ext.properties


##
## LDAP
##

    #
    # You can write your own class that implements
    # com.liferay.portal.security.ldap.AttributesTransformer to transform the
    # LDAP attributes before a user or group is imported to the LDAP store.
    #
    ldap.attrs.transformer.impl=com.liferay.portal.security.ldap.DefaultAttributesTransformer


Implement your logic inside the method transformUser
karthik N,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Regular Member 帖子: 106 加入日期: 11-7-1 最近的帖子
Hi,
I don't know how to get the Ldap attributes into my custom class...
can u please give me smilar example or give me some link related to that?



Thanks

Regards,
Karthik N
thumbnail
Thiago Leão Moreira,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Liferay Legend 帖子: 1449 加入日期: 07-10-10 最近的帖子
Your custom class will be called by Liferay and Liferay will populate the Attributes object with the information from the LDAP regarding your user.
thumbnail
Mani kandan,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Expert 帖子: 492 加入日期: 10-9-15 最近的帖子
Hi karthik,

I think this thread will help you
thumbnail
Udaya Ramakrishnan,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Junior Member 帖子: 67 加入日期: 11-9-7 最近的帖子
hi

i have created a new hook for creating a class that implements com.liferay.portal.security.ldap.AttributesTransformer and configured in portal.ext.properties
but i am getting class not found Exception
herewith i include the error i am getting. can u pls help me in overcome from this.
Solution need in urgent

Thank you

Regards
Udaya.R
thumbnail
Mani kandan,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Expert 帖子: 492 加入日期: 10-9-15 最近的帖子
Where did you paste this package com.liferay.portal.security.ldap.AttributesTransformer?
thumbnail
Udaya Ramakrishnan,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Junior Member 帖子: 67 加入日期: 11-9-7 最近的帖子
hi Mani Kandan,

Thank u for ur quick reply.
i have created a hook. i didnt paste the package anywhere.

Regards
Udaya.R
thumbnail
Udaya Ramakrishnan,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Junior Member 帖子: 67 加入日期: 11-9-7 最近的帖子
hi Thiago,

As u said i created a Ext and modified the class DefaultAttributesTransformer that gets implemented from AttributesTransformer.
with the transformUser(), i added my custom code and i configured in portal-ext.properties.
now i can able to modified the Ldap Attributes.
but now i have a doubt that "DefaultAttributesTransformer " is a class within LR source.
Is it correct to modified that class? or i have to create a Custom class that implements AttributesTransformer?
As i am new to Liferay, dont mistake me if my question is wrong.
Waiting for ur reply.

Thank You


Regards
UdayaR
thumbnail
Thiago Leão Moreira,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Liferay Legend 帖子: 1449 加入日期: 07-10-10 最近的帖子
Hi Udaya,

You can extend DefaultAttributesTransformer or implement AttributesTransformer either case are correct (both are public API) and won't give you problems during a Liferay upgrade.
thumbnail
Udaya Ramakrishnan,修改在12 年前。

RE: LDAP query for map prefix of email address to liferay screen name

Junior Member 帖子: 67 加入日期: 11-9-7 最近的帖子
hi,

Thank u for ur reply.


Regards
Udaya.R