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

Reply via email to