Hi,
Right now I am authentication via ldap and getting attributes from different
resources (LDAP and database) using the MergingPersonAttributeDaoImpl.
The problem is that I want to change the join attribute when I am selecting the
attributes from the data base.
Right now the join attribute between the ldap and the database is the username.
What if I want to select different join attribute than username (which exists
on the ldap attributes)?
this is the configuration:
<!-- taking attributes from ldap + database only -->
<bean id="attributeRepository"
class="org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl">
<property name="personAttributeDaos">
<list>
<bean
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
<constructor-arg index="0" ref="dataSource1"/>
<constructor-arg index="1" value="SELECT * FROM USER_DATA WHERE
{0}"/>
<property name="queryAttributeMapping">
<map>
//now here I want diffrent key. for example - description
<entry key="username" value="LOGINNAME"/>
</map>
</property>
<property name="resultAttributeMapping">
<map>
<entry key="ROLE_NAME" value="ROLE_NAME"/>
<entry key="PERMISSIONS" value="PERMISSIONS"/>
<entry key="APP_NAME" value="APP_NAME"/>
</map>
</property>
</bean>
<bean id="attributeRepository"
class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
<property name="contextSource" ref="contextSource"/>
<property name="requireAllQueryAttributes" value="false"/>
<property name="baseDN" value="ou=Users,dc=openiam,dc=com"/>
<property name="queryAttributeMapping">
<map>
<entry key="username" value="uid"/>
</map>
</property>
<property name="resultAttributeMapping">
<map>
<entry key="cn" value="FullName"/>
<entry key="sn" value="LastName"/>
<entry key="mail" value="mail"/>
<entry key="description" value="description"/>
</map>
</property>
</bean>
</list>
</property>
</bean>
I tried to change it. and it didnt work:
2013-10-31 16:45:38,166 DEBUG
[org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl] - <Created
seed map='{username=[ifridman]}' for uid='ifridman'>
2013-10-31 16:45:38,167 DEBUG
[org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] -
<Generated query builder 'null' from query Map {username=[ifridman]}.>
2013-10-31 16:45:38,167 DEBUG
[org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] -
<No queryBuilder was generated for query {username=[ifridman]}, null will be
returned>
2013-10-31 16:45:38,167 DEBUG
[org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl] -
<Retrieved attributes='null' for query='{username=[ifridman]}', isFirstQuery=f
thanks.
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user