After many hours debugging, I came across online sample that helped me.

I will post it here for future user's reference:

    <bean id="authenticationManager"
        class="org.jasig.cas.authentication.AuthenticationManagerImpl">

        <property name="credentialsToPrincipalResolvers">
            <list>
                    <bean
class="org.jasig.cas.authentication.principal.CredentialsToLDAPAttributePrincipalResolver">

                        <property name="credentialsToPrincipalResolver">
                            <bean
class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"/>

                        </property>
                        <property name="filter"
value="(sAMAccountName=%u)"/>
                        <property name="principalAttributeName"
value="sAMAccountName"/>
                        <property name="searchBase" value="@@basednpath@@"/>

                        <property name="contextSource"
ref="contextSource"/>
                        <property name="attributeRepository">
                            <ref bean="attributeRepository"/>
                        </property>
                    </bean>
            </list>
        </property>


        <property name="authenticationHandlers">
            <list>

                <bean
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
                    p:httpClient-ref="httpClient" />


                    <bean
class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler">
                           <property name="filter"
value="sAMAccountName=%u" />
                           <property name="searchBase" value="@@basednpath@@"
/>
                           <property name="contextSource"
ref="contextSource" />
                           <property name="ignorePartialResultException"
value="yes" /> <!-- fix because of how AD returns results -->
                    </bean>
            </list>
        </property>
    </bean>

    <bean id="attributeRepository"
  class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
<property name="ignorePartialResultException" value="yes"/>
  <property name="contextSource" ref="contextSource" />
  <property name="baseDN" value="@@basednpath@@" />
  <property name="requireAllQueryAttributes" value="true" />



  <property name="queryAttributeMapping">
    <map>
      <entry key="username" value="sAMAccountName" />
    </map>
  </property>

  <property name="resultAttributeMapping">
    <map>
    <entry key="cn" value="cn"/>
    <entry value="mail" key="Mail" />
    <entry value="description" key="description" />
    <entry value="memberOf" key="memberOf" />
    <entry value="displayName" key="displayName" />
    <entry value="givenName" key="givenName" />
    <entry value="employeeID" key="employeeID" />
    <entry value="sn" key="sn" />
    </map>
  </property>
</bean>




On Tue, May 15, 2012 at 2:29 PM, Myn Harry <[email protected]> wrote:

> Hi:
>
> I was setting up release of attributes for CAS 3.4.11 by following
> instruction at https://wiki.jasig.org/display/CASUM/Attributes.
>
> The updates made to my *deployerConfigContext.xml *are listed below.*
>
> *Upon starting Tomcat, I am getting error:
> *"Error creating bean with name
> 'org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver#35a3e41f'
> defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]:
> Cannot resolve reference to bean 'attributeRepository' while setting bean
> property 'attributeRepository'; nested exception is
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
> named 'attributeRepository' is defined"**
>
> *There is something I must be obviously missing but I cannot see it *- *can
> you help let me know where I have deviated from the documentation?
>
> Update for *deployerConfigContext:*
>
>                 <bean
> class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"
> >
>                     <property name="attributeRepository"
> ref="attributeRepository" />
>                 </bean>
>
>                 <!-- LdapPersonAttributeDao Bean-->
>                 <bean id="attributeRepository"
> class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
>                     <property name="contextSource" ref="contextSource" />
>                     <property name="baseDN" value="ou=account,o=xxx.edu"
> />
>                     <property name="requireAllQueryAttributes"
> value="true" />
>
>                     <!--
>                         Attribute mapping between principal (key) and LDAP
> (value) names
>                         used to perform the LDAP search.  By default,
> multiple search criteria
>                         are ANDed together.  Set the queryType property to
> change to OR.
>                     -->
>                     <property name="queryAttributeMapping">
>                         <map>
>                             <entry key="username" value="campusLoginName"
> />
>                         </map>
>                     </property>
>
>                     <property name="resultAttributeMapping">
>                         <map>
>                             <!-- Mapping beetween LDAP entry attributes
> (key) and Principal's (value) -->
>                             <entry key="username" value="campusLoginName"/>
>                             <entry value="office" key="office" />
>                         </map>
>                     </property>
>                 </bean>
>

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