Skip to content
This repository has been archived by the owner on Nov 3, 2017. It is now read-only.

Configuring AcceptUsersAuthenticationHandler with a custom XML element

Dmitriy Kopylenko edited this page Jan 3, 2014 · 4 revisions

Since version 1.6 there is a custom XML element in cas-addons XML schema and a corresponding bean definition parser for configuring CAS' AcceptUsersAuthenticationHandler. The "raw" bean definition looks like this:

<bean id="acceptUsersAuthnHandler" class="org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler">
        <property name="users">
            <map>
                <entry key="user1" value="pass1"/>
                <entry key="user2" value="pass2"/>
            </map>
        </property>
</bean>

A bean definition using custom namespace element looks like this (note: the id attribute is optional):

<cas:accept-users-authentication-handler id="acceptUsersAuthnHandler">
        <cas:user name="user1" password="pass1"/>
        <cas:user name="user2" password="pass2"/>
</cas:accept-users-authentication-handler>

which is more domain specific, and adds the benefits of using XML schema validation and auto-completion tooling.