Re: Error while launching Login page
Can you give an example? -Borut 2009/4/22 Otho taa...@googlemail.com: It is also straightforward to configure Spring Secuity as usual (aka in Spring config), if you should need features which are not yet in the spring security module or should use spring data access abstractions anyways. 2009/4/21 Borut Bolčina borut.bolc...@gmail.com Hi, did you have a look at http://www.localhost.nu/java/tapestry-spring-security/? There is also a sample application to download at http://www.localhost.nu/svn/public/tapestry-spring-security-sample/ HTH, Borut 2009/4/21 ChandraB b_chan...@yahoo.com: I am a newbie to tapestry, i am getting NullPointerException when i access authManager. How do i inject AuthManager? Chandra ChandraB wrote: Service id 'authenticationProvider' is not defined by any module My appModule.java is as below public class AppModule { public static void bind(ServiceBinder binder) { binder.bind(com.eveo.edetail.reporting.service.UserDetailsService.class, UserDetailsServiceImpl.class).withId(UserDetailsServiceImpl); binder.bind(SaltSourceService.class, SaltSourceImpl.class).withId(SaltSourceImpl); } public static SaltSourceService buildMySaltSource() throws Exception { SaltSourceImpl saltSource = new SaltSourceImpl(); saltSource.setSystemWideSalt(DEADBEEF); saltSource.afterPropertiesSet(); return saltSource; } public static UserDetailsService buildUserDetailsService(UserDao userDao) { return new com.eveo.edetail.reporting.service.impl.UserDetailsServiceImpl(userDao); } public static void contributeProviderManager( OrderedConfigurationAuthenticationProvider configuration, @InjectService(DaoAuthenticationProvider) AuthenticationProvider daoAuthenticationProvider) { System.out.println(AppModule: contributeProviderManager + configuration); System.out.println(+daoAuthenticationProvider); configuration.add(daoAuthenticationProvider, daoAuthenticationProvider); } public static AuthenticationProcessingFilter buildMyAuthenticationProcessingFilter( @AcegiServices final AuthenticationManager manager, @AcegiServices final RememberMeServices rememberMeServices, @Inject @Value(${acegi.check.url}) final String authUrl, @Inject @Value(${acegi.target.url}) final String targetUrl, @Inject @Value(${acegi.failure.url}) final String failureUrl) throws Exception { System.out.println(Auth URL+ authUrl ); AuthenticationProcessingFilter filter = new AuthenticationProcessingFilter(); filter.setAuthenticationManager(manager); filter.setAuthenticationFailureUrl(failureUrl); filter.setDefaultTargetUrl(targetUrl); filter.setFilterProcessesUrl(authUrl); filter.setRememberMeServices(rememberMeServices); filter.afterPropertiesSet(); return filter; } public static void contributeAliasOverrides( @InjectService(MySaltSource) SaltSourceService saltSource, @InjectService(MyAuthenticationProcessingFilter) AuthenticationProcessingFilter authenticationProcessingFilter, ConfigurationAliasContribution configuration) { System.out.println(AppModule: contributeAliasOverrides + configuration); configuration.add(AliasContribution.create(SaltSourceService.class,saltSource)); configuration.add(AliasContribution.create(AuthenticationProcessingFilter.class,authenticationProcessingFilter)); } public static LoginHelper buildLoginHelper(@InjectService(MySaltSource) SaltSourceService saltSource, PasswordEncoder encrypter , AuthenticationManager authManager) { return new AcegiLoginHelper(authManager,saltSource,encrypter); //return new AcegiLoginHelper(authManager); } public static void contributeApplicationDefaults(MappedConfigurationString, String configuration){ configuration.add(SymbolConstants.SUPPORTED_LOCALES, en); configuration.add(SymbolConstants.PRODUCTION_MODE, false); configuration.add(acegi.failure.url, /error); configuration.add(acegi.password.encoder, org.acegisecurity.providers.encoding.PlaintextPasswordEncoder); configuration.add(acegi.target.url, /Program); } /** * This is a service definition, the service will be named TimingFilter. The interface, * RequestFilter, is used within the RequestHandler service pipeline, which is built from the * RequestHandler service configuration.
Re: Error while launching Login page
I am a newbie to tapestry, i am getting NullPointerException when i access authManager. How do i inject AuthManager? Chandra ChandraB wrote: Service id 'authenticationProvider' is not defined by any module My appModule.java is as below public class AppModule { public static void bind(ServiceBinder binder) { binder.bind(com.eveo.edetail.reporting.service.UserDetailsService.class, UserDetailsServiceImpl.class).withId(UserDetailsServiceImpl); binder.bind(SaltSourceService.class, SaltSourceImpl.class).withId(SaltSourceImpl); } public static SaltSourceService buildMySaltSource() throws Exception { SaltSourceImpl saltSource = new SaltSourceImpl(); saltSource.setSystemWideSalt(DEADBEEF); saltSource.afterPropertiesSet(); return saltSource; } public static UserDetailsService buildUserDetailsService(UserDao userDao) { return new com.eveo.edetail.reporting.service.impl.UserDetailsServiceImpl(userDao); } public static void contributeProviderManager( OrderedConfigurationAuthenticationProvider configuration, @InjectService(DaoAuthenticationProvider) AuthenticationProvider daoAuthenticationProvider) { System.out.println(AppModule: contributeProviderManager + configuration); System.out.println(+daoAuthenticationProvider); configuration.add(daoAuthenticationProvider, daoAuthenticationProvider); } public static AuthenticationProcessingFilter buildMyAuthenticationProcessingFilter( @AcegiServices final AuthenticationManager manager, @AcegiServices final RememberMeServices rememberMeServices, @Inject @Value(${acegi.check.url}) final String authUrl, @Inject @Value(${acegi.target.url}) final String targetUrl, @Inject @Value(${acegi.failure.url}) final String failureUrl) throws Exception { System.out.println(Auth URL+ authUrl ); AuthenticationProcessingFilter filter = new AuthenticationProcessingFilter(); filter.setAuthenticationManager(manager); filter.setAuthenticationFailureUrl(failureUrl); filter.setDefaultTargetUrl(targetUrl); filter.setFilterProcessesUrl(authUrl); filter.setRememberMeServices(rememberMeServices); filter.afterPropertiesSet(); return filter; } public static void contributeAliasOverrides( @InjectService(MySaltSource) SaltSourceService saltSource, @InjectService(MyAuthenticationProcessingFilter) AuthenticationProcessingFilter authenticationProcessingFilter, ConfigurationAliasContribution configuration) { System.out.println(AppModule: contributeAliasOverrides + configuration); configuration.add(AliasContribution.create(SaltSourceService.class,saltSource)); configuration.add(AliasContribution.create(AuthenticationProcessingFilter.class,authenticationProcessingFilter)); } public static LoginHelper buildLoginHelper(@InjectService(MySaltSource) SaltSourceService saltSource, PasswordEncoder encrypter , AuthenticationManager authManager) { return new AcegiLoginHelper(authManager,saltSource,encrypter); //return new AcegiLoginHelper(authManager); } public static void contributeApplicationDefaults(MappedConfigurationString, String configuration){ configuration.add(SymbolConstants.SUPPORTED_LOCALES, en); configuration.add(SymbolConstants.PRODUCTION_MODE, false); configuration.add(acegi.failure.url, /error); configuration.add(acegi.password.encoder, org.acegisecurity.providers.encoding.PlaintextPasswordEncoder); configuration.add(acegi.target.url, /Program); } /** * This is a service definition, the service will be named TimingFilter. The interface, * RequestFilter, is used within the RequestHandler service pipeline, which is built from the * RequestHandler service configuration. Tapestry IoC is responsible for passing in an * appropriate Logger instance. Requests for static resources are handled at a higher level, so * this filter will only be invoked for Tapestry related requests. * * p * Service builder methods are useful when the implementation is inline as an inner class * (as here) or require some other kind of special initialization. In most cases, * use the static bind() method
Re: Error while launching Login page
Hi, did you have a look at http://www.localhost.nu/java/tapestry-spring-security/? There is also a sample application to download at http://www.localhost.nu/svn/public/tapestry-spring-security-sample/ HTH, Borut 2009/4/21 ChandraB b_chan...@yahoo.com: I am a newbie to tapestry, i am getting NullPointerException when i access authManager. How do i inject AuthManager? Chandra ChandraB wrote: Service id 'authenticationProvider' is not defined by any module My appModule.java is as below public class AppModule { public static void bind(ServiceBinder binder) { binder.bind(com.eveo.edetail.reporting.service.UserDetailsService.class, UserDetailsServiceImpl.class).withId(UserDetailsServiceImpl); binder.bind(SaltSourceService.class, SaltSourceImpl.class).withId(SaltSourceImpl); } public static SaltSourceService buildMySaltSource() throws Exception { SaltSourceImpl saltSource = new SaltSourceImpl(); saltSource.setSystemWideSalt(DEADBEEF); saltSource.afterPropertiesSet(); return saltSource; } public static UserDetailsService buildUserDetailsService(UserDao userDao) { return new com.eveo.edetail.reporting.service.impl.UserDetailsServiceImpl(userDao); } public static void contributeProviderManager( OrderedConfigurationAuthenticationProvider configuration, @InjectService(DaoAuthenticationProvider) AuthenticationProvider daoAuthenticationProvider) { System.out.println(AppModule: contributeProviderManager + configuration); System.out.println(+daoAuthenticationProvider); configuration.add(daoAuthenticationProvider, daoAuthenticationProvider); } public static AuthenticationProcessingFilter buildMyAuthenticationProcessingFilter( @AcegiServices final AuthenticationManager manager, @AcegiServices final RememberMeServices rememberMeServices, @Inject @Value(${acegi.check.url}) final String authUrl, @Inject @Value(${acegi.target.url}) final String targetUrl, @Inject @Value(${acegi.failure.url}) final String failureUrl) throws Exception { System.out.println(Auth URL+ authUrl ); AuthenticationProcessingFilter filter = new AuthenticationProcessingFilter(); filter.setAuthenticationManager(manager); filter.setAuthenticationFailureUrl(failureUrl); filter.setDefaultTargetUrl(targetUrl); filter.setFilterProcessesUrl(authUrl); filter.setRememberMeServices(rememberMeServices); filter.afterPropertiesSet(); return filter; } public static void contributeAliasOverrides( @InjectService(MySaltSource) SaltSourceService saltSource, @InjectService(MyAuthenticationProcessingFilter) AuthenticationProcessingFilter authenticationProcessingFilter, ConfigurationAliasContribution configuration) { System.out.println(AppModule: contributeAliasOverrides + configuration); configuration.add(AliasContribution.create(SaltSourceService.class,saltSource)); configuration.add(AliasContribution.create(AuthenticationProcessingFilter.class,authenticationProcessingFilter)); } public static LoginHelper buildLoginHelper(@InjectService(MySaltSource) SaltSourceService saltSource, PasswordEncoder encrypter , AuthenticationManager authManager) { return new AcegiLoginHelper(authManager,saltSource,encrypter); //return new AcegiLoginHelper(authManager); } public static void contributeApplicationDefaults(MappedConfigurationString, String configuration){ configuration.add(SymbolConstants.SUPPORTED_LOCALES, en); configuration.add(SymbolConstants.PRODUCTION_MODE, false); configuration.add(acegi.failure.url, /error); configuration.add(acegi.password.encoder, org.acegisecurity.providers.encoding.PlaintextPasswordEncoder); configuration.add(acegi.target.url, /Program); } /** * This is a service definition, the service will be named TimingFilter. The interface, * RequestFilter, is used within the RequestHandler service pipeline, which is built from the * RequestHandler service configuration. Tapestry IoC is responsible for passing in an * appropriate Logger instance. Requests for static resources are handled at a higher level, so * this filter will only be invoked for Tapestry related requests. * * p * Service builder methods are useful when the implementation is inline as an inner class * (as here) or require some other kind of special