Hello, everyone! I get it working well.
For those who may need in the future I reverse the order of handlers. Before the first attempt was made to authenticate via LDAP if it fails should try the Database. What did not work. Just ldap was attempt Now, reversing the order, everything works. First I try to log in through the database and if it fails an attempt is made to login via LDAP. The two routes are performed as expected. Thanks anyway, Weer On Wed, Sep 11, 2013 at 11:43 AM, Weder Carlos Vieira < [email protected]> wrote: > Hello, > > I did spend very time to search on google if there is example of using CAS > with two differente ways to authenticate, but sorry to say that I didn't > find out... > > Please, someone could show me how I can do that? > > See key parts of my deployerConfigContext.xml > > ... > <property name="authenticationHandlers"> > <list> > <bean > > class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" > p:httpClient-ref="httpClient" /> > > <bean > > class="org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler"> > <property name="filter" value="%u@ldapdomain1" /> > <property name="contextSource" ref="contextSource" /> > <property name="ignorePartialResultException" > value="yes" /> > </bean> > > <bean > > class="org.jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler"> > <property name="tableUsers" value="users" /> > <property name="fieldUser" value="user_id" /> > <property name="fieldPassword" value="passwd" /> > <property name="passwordEncoder"> > <bean > > class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder" > p:characterEncoding="UTF-8"> > <constructor-arg value="MD5" /> > </bean> > </property> > <property name="dataSource" ref="dataSource" /> > </bean> > </list> > </property> > .... > > Below the support contextSource and dataSource configs: > > <bean id="contextSource" > class="org.springframework.ldap.core.support.LdapContextSource"> > <property name="pooled" value="false" /> > <property name="url" value="ldap://ldapdomain1" /> > </bean> > > > <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> > <property name="driverClassName" value="com.mysql.jdbc.Driver" /> > <property name="url" value="jdbc:mysql://localhost:3306/cas_test" > /> > <property name="username" value="root" /> > <property name="password" value="root" /> > </bean> > .... > > An observation, If I test both configuration LDAP and DataBase separated, > it works very well, together, on the other hand the CAS server just try > authenticate through just one way. > In other words, If I comment LDAP configs and try to authenticate through > database, it works. uncommenting LDAP configs and commenting database > configs, LDAP works too. > > Both configs together just one is tried to authenticate. > > There is any config that should I do to get it working? > I just want that CAS server tries to authenticate first through LDAP, if > it fails, then try to authenticate through database. > > > Thanks if someone can help-me > -- 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
