Hi,
In my post I paste the wrong code of the repository retrieved(the second code 
bulk example). That’s the right code:




<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>
                    <entry key="username" value="LOGINNAME"/>
                       //here I would like to use diffrenty entry key than 
username. how?

                  </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>

-----Original Message-----
From: ray [mailto:[email protected]]
Sent: Monday, November 04, 2013 11:44 AM
To: [email protected]
Subject: [cas-user] How to get attributes from repository by different entry key

Hi,
I asked that question before but no answer. I think my question wasn't clear so 
I'll try again:

I am using CAS to authenticate against ldap:

 <property name="credentialsToPrincipalResolvers">
      <list>
        <bean 
class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver"/>
        <bean 
class="org.jasig.cas.authentication.principal.CredentialsToLDAPAttributePrincipalResolver">
          <property name="credentialsToPrincipalResolver">
            <bean 
class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"/>
          </property>
          <property name="filter" value="(uid=%u)"/>
          <property name="principalAttributeName" value="uid"/>
          <property name="searchBase" value="ou=Users,dc=openiam,dc=com"/>
          <property name="contextSource" ref="contextSource"/>
          <property name="attributeRepository" ref="attributeRepository"/>
        </bean>
      </list>
    </property>


I am also take attributes from DB:


<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>

Now the entry key to select the attributes from the database is by the username 
which was retrieved from LDAP:

  <entry key="username" value="uid"/>

In my case I would like to select the attributes from the Database via 
different entry key (which was retrieved from the LDAP).

For example:

 let's say I have this record in ldap:

username: john
email: [email protected]

Now after authentication I want to select from the Database the attributes this 
way:
select * from USERS_ATTRS where email={0}

* {0} is the email attribute which was retrieved from LDAP.

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
This e-mail and the information it contains may be privileged and/or 
confidential. It is intended solely for the use of the named recipient(s). If 
you are not the intended recipient you may not disclose, copy, distribute or 
retain any part of this message or attachments. If you have received this 
e-mail in error please notify the sender immediately [by clicking 'Reply'] and 
delete this e-mail.
This e-mail and the information it contains may be privileged and/or 
confidential. It is intended solely for the use of the named recipient(s). If 
you are not the intended recipient you may not disclose, copy, distribute or 
retain any part of this message or attachments. If you have received this 
e-mail in error please notify the sender immediately [by clicking 'Reply'] and 
delete this e-mail.

-- 
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

Reply via email to