I've implemented a Jaas Login Module, in order to perform authentication. I must access database to retrieve user/pass information within this module.
In the same project, there exists some DAO bean's implemented, but it's impossible to access Spring context from the jaas login module, to retrieve the DAO bean.
¿Anyone could help me please?
I'm using Spring Security to integrate Jaas in my application.
If you have access to the LoginModule, simply add the interface ApplicationContextAware and a bean definition for the LoginModule. When the application starts the context will be available within the module.
public class LoginModule implements ApplicationContextAware {
private ApplicationContext applicationContext;
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
}
Javadoc for the interface: http://static.springsource.org/spring/docs/3.0.5.RELEASE/api/org/springframework/context/ApplicationContextAware.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With