On Tue, 06 Jan 2015 15:00:51 -0800
Kristen Walker <[email protected]> wrote:

> I am desperately trying to get CAS to authenticate from our LDAP server and
> I tried using the example you posted, modifying the values for our
> environment. I seem to be having a lot of trouble with this portion of the
> example:
> 
> <bean id="ldapAuthenticationHandler"
> class="org.jasig.cas.authentication.LdapAuthenticationHandler"
> p:principalIdAttribute="cn">
>         <constructor-arg ref="authenticator" />
>         <property name="principalAttributeMap">
>             <map>
>                 <entry key="mail" value="mail" />
>                 <entry key="cn" value="cn" />
>             </map>
>         </property>
>     </bean>
> 
> The error message I get is:
> 
> INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
> 2015-01-06 14:57:38,344 ERROR
> [org.springframework.web.context.ContextLoader] - <Context initialization
> failed>
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 79 in XML document from ServletContext resource
> [/WEB-INF/deployerConfigContext.xml] is invalid; nested exception is
> org.xml.sax.SAXParseException; lineNumber: 79; columnNumber: 19;
> cvc-complex-type.2.3: Element 'map' cannot have character [children],
> because the type's content type is element-only.

Syntax seems OK, but in order to avoid some unseeable content between "<map>"
and "<entry..." you could put it as a entire line:

<map><entry key="mail" value="mail" /><entry key="cn" value="cn" /></map>

If it helps, my working syntax for that bean is slightly different:

    <bean id="ldapAuthenticationHandler"
        class="org.jasig.cas.authentication.LdapAuthenticationHandler"
        p:principalIdAttribute="cn"
        c:authenticator-ref="authenticator">
        <property name="principalAttributeMap">
            <map>
                <entry key="mail" value="mail" />
                <entry key="displayName" value="displayName" />
            </map>
        </property>
    </bean>


-- 
Alberto Cabello Sánchez
<[email protected]>

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