You don't need to develop an own auth handler, if one of the jdbc handlers who come with cas are enough for your needs.

See http://www.ja-sig.org/wiki/display/CASUM/JDBC

Example:
Set the handler up in the deployerConfigContext.xml file:

<bean id="authenticationManager"... >
....
<property name="authenticationHandlers">
 <list>
<bean class = "org ..jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler"> <property name="tableUsers"><value>yourUserTableName</value></ property> <property name="fieldUser"><value " >yourUsernameFieldName</ value></property> <property name="fieldPassword"><value>yourPwFieldName</value></ property>
    <property name="dataSource" ref=dbAuthDataSource"/>
    <!-- Use the same PW Encoder as your db -->
    <property name="passwordEncoder">
        <bean
          class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder">
          <constructor-arg value="MD5"/>
        </bean>
    </property>
   </bean>
 </list>
</property>
....
</bean>

<bean id="dbAuthDataSource" class="org.apache.commons.dbcp.BasicDataSource">
  <property name="driverClassName">
    <value>com.mysql.jdbc.Driver</value>
  </property>
  <property name="url">
    <value>jdbc:mysql://localhost:3306/mydb</value>
  </property>
  <property name="username">
    <value>yourDBUserName</value>
  </property>
  <property name="password">
   <value>yourDBPassword</value>
  </property>
</bean>



Bye, Robert

Am 13.02.2009 um 18:46 schrieb Vinicius Borges:

Hi everybody,

I want to login only users that are in a database. So, where and what I have to change to do it?
There's a class in cas-server that I have to develop?

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



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