You figured out why its not working, you haven't defined a bean for your UserManagementService. If you don't do that, then its clearly not going to work. Try doing that and if you have more errors, put them there.
Two things though: 1. You can use the AbstractUsernamePasswordAuthenticationHandler defined in CAS to cut down on some of the code you need to write 2. You should log those errors instead of printing them and the stack trace. Cheers, Scott On Fri, Aug 14, 2009 at 4:35 AM, Pablo Mosquera Saenz < [email protected]> wrote: > Hi, Im using CAS 3.0.7 as part of a SOA framework. > > I have now a LDAPAuthenticationHandler working, but I want to develop > another handler to authenticate users against database. > > My handler: > > > *public void setUserService(UserManagementService service) {* > *this.userService = service;* > *}* > *public boolean authenticate(Credentials casCredentials) throws > AuthenticationException {* > *UsernamePasswordCredentials credentials = (UsernamePasswordCredentials) > casCredentials;* > *String login = credentials.getUsername();* > *String password = credentials.getPassword();* > *System.out.println("authenticate");* > *try {* > *String result = userService.hazLogin(login, password);* > *return result.equals("");* > *} catch (Exception e) {* > *e.printStackTrace();* > *return false;* > *}* > *}* > > *public boolean supports(Credentials credentials) {* > *return credentials instanceof UsernamePasswordCredentials;* > *} > }* > ** > I define in deployerConfigContext.xml the new handler > > * <property name="authenticationHandlers"> > <list> > <bean id="oracleAuthenticationHandler" > class="es.cptopt.framework.cas.authentication.OracleAuthenticationHandler"> > <property name="UserManagementService" > ref="UserManagementServiceTarget"></property> > </bean> > > <bean id="ldapAuthenticationHandler" > class="es.cptopt.framework.cas.authentication.LDAPAuthenticationHandler"> > <property name="LDAPCPTOPTService" > ref="LDAPCPTOPTService"></property> > </bean>* > * <bean > class="org.acegisecurity.adapters.cas3.CasAuthenticationHandler"> > <property name="authenticationManager" > ref="acegiAuthenticationManager" /> > </bean>* > * </list> > </property>* > ** > ** > The problem is that I have in CAS project the jar with the > UserManagementService, and I have an NoSuchBeanDefinitionException with * > UserManagementServiceTarget.* > ** > If I define this bean in the CAS applicationContext, I still have > dependiencies to resolve. > > When I deploy CAS, why I cant make reference to beans of other services? > > > > Regards > > -- > 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
