You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Jansky Jiri <ji...@pageup.cz> on 2009/09/15 18:06:31 UTC

store user attributes in LDAP

Hi, 
we are still testing using Jetspeed 2.2.0 with ldap. Now, we would need store (read and write) user atrributes in LDAP. (These attributes that are described for example here - http://portals.apache.org/jetspeed-2/deployguide/guide-user-attributes.html). 
I find some information that said, it should be possible in 2.2.0 version (http://www.mailinglistarchive.com/jetspeed-user@portals.apache.org/msg05856.html) and some solved bug record (https://issues.apache.org/jira/browse/JS2-301) but I still don't know, how to configure it (lack of documentation?). Can anybody help me? 

Thanks 
Jiri Jansky 

Re: store user attributes in LDAP

Posted by Aysegul Aydin <ay...@yahoo.com>.
Hi,

You can configure jetspeed2.2.0 to store and retrieve attributes from LDAP through security-ldap.xml file. This file is located under WEB-INF/assembly directory of your portal project (under your Tomcat webapps directory) In this file, you define your LDAP entities and their attributes. For user attributes, take a look at the bean with id "UserDaoConfiguration". In this bean definition, LDAP atttributes are defined with possible mappings to jetspeed user entity attributes (the one that is stored in your database). Here is a sample configuration from our file:

    <bean id="UserDaoConfiguration" class="org.apache.jetspeed.security.mapping.ldap.dao.LDAPEntityDAOConfiguration" init-method="initialize">
        <meta key="j2:cat" value="ldapSecurity" />
        <property name="baseDN" value="${ldap.base}" />
        <property name="searchDN" value="${ldap.user.searchBase}" />
        <property name="searchFilter">
            <bean class="org.apache.jetspeed.security.mapping.ldap.filter.SimpleFilter">
                <constructor-arg index="0" value="(objectClass=inetOrgPerson)" />
            </bean>
        </property>
        <property name="ldapIdAttribute" value="cn" />
        <property name="objectClasses" value="inetOrgPerson,organizationalPerson,person,top" />
        <property name="attributeDefinitions">
            <set>
                <bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
                    <constructor-arg type="java.lang.String" index="0" value="uid" />
                    <constructor-arg index="1" value="false" />
                    <constructor-arg index="2" value="false" />
                    <property name="required" value="true" />
                    <property name="idAttribute" value="true" />
                </bean>
                <bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
                    <constructor-arg type="java.lang.String" index="0" value="cn" />
                    <constructor-arg index="1" value="false" />
                    <constructor-arg index="2" value="false" />
                    <property name="required" value="true" />
                    <property name="idAttribute" value="true" />
                </bean>
                <bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
                    <constructor-arg type="java.lang.String" index="0" value="sn" />
                    <constructor-arg index="1" value="false" />
                    <constructor-arg index="2" value="false" />
                    <property name="required" value="true" />
                    <property name="idAttribute" value="true" />
                </bean>
                <bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
                    <constructor-arg type="java.lang.String" index="0" value="givenName" />
                    <constructor-arg index="1" value="false" />
                    <constructor-arg index="2" value="true" />
                    <constructor-arg type="java.lang.String" index="3" value="user.name.given" />
                </bean>
                <bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
                    <constructor-arg type="java.lang.String" index="0" value="initials" />
                    <constructor-arg index="1" value="false" />
                    <constructor-arg index="2" value="true" />
                    <constructor-arg type="java.lang.String" index="3" value="user.name.family" />
                </bean>
                <bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
                    <constructor-arg type="java.lang.String" index="0" value="o" />
                    <constructor-arg index="1" value="false" />
                    <constructor-arg index="2" value="false" />
                </bean>
            </set>
        </property>
        <property name="entityType" value="user" />
    </bean>

In this sample, pay attention to attributes named "givenName" and "initials". We store and retrieve "user.name.given" and "user.name.family" user attributes in these LDAP attributes. Here, you should keep in mind that these attributes will be synchronized with LDAP in every startup of your portal application.

Hope it helps,
Aysegul.



----- Original Message ----
From: Jansky Jiri <ji...@pageup.cz>
To: jetspeed-user <je...@portals.apache.org>
Sent: Tuesday, September 15, 2009 7:06:31 PM
Subject: store user attributes in LDAP

Hi, 
we are still testing using Jetspeed 2.2.0 with ldap. Now, we would need store (read and write) user atrributes in LDAP. (These attributes that are described for example here - http://portals.apache.org/jetspeed-2/deployguide/guide-user-attributes.html). 
I find some information that said, it should be possible in 2.2.0 version (http://www.mailinglistarchive.com/jetspeed-user@portals.apache.org/msg05856.html) and some solved bug record (https://issues.apache.org/jira/browse/JS2-301) but I still don't know, how to configure it (lack of documentation?). Can anybody help me? 

Thanks 
Jiri Jansky 



      

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org