Help with - Spring Security, JAAS, authentication-provider, UserDetailsService
Hi,
I am using Spring Security 2.0.1 with JAAS (J2SE 5) for a web application. I am at a loss to understand how to setup the <authentication-provider> within my security context as it expects a UserDetailsService implementation. All I have is JAAS that is supposed to provide the userDetails/authentication information.
Here is the snippet from applicationContext.xml
<bean id="jaasAuthenticationProvider"
class="org.springframework.security.providers.jaas .JaasAuthenticationProvider">
<security:custom-authentication-provider/>
<property name="loginConfig" value="/WEB-INF/login.conf" />
<property name="loginContextName" value="RDBMSLogin" />
<property name="callbackHandlers">
<list>
<bean
class="org.springframework.security.providers.jaas .JaasNameCallbackHandler" />
<bean
class="org.springframework.security.providers.jaas .JaasPasswordCallbackHandler" />
</list>
</property>
<property name="authorityGranters">
<list>
<bean
class="sample.framework.security.authorization.MyA uthorityGranter" />
</list>
</property>
</bean>
Here is the securityContext.xml
<beans:beans xmlns="...">
<http auto-config='true'>
<intercept-url pattern="/**" access="ROLE_USER" />
<form-login />
<anonymous />
<http -basic />
<logout />
<remember-me />
</http >
<authentication-provider user-service-ref='WHAT-SHOULD-I-PUT-IN-HERE?'/>
</beans:beans>
Help with - Spring Security, JAAS, authentication-provider, UserDetailsService
Thanks robinbajaj. I tried the option you mentioned, but still does not work. It still expects the UserDetailsService implementation. Anyways I will keep trying other options - may be implement UserDetailsService that interfaces with JAAS.