JAAS and struts
843834Oct 1 2002 — edited Nov 11 2002Someone please help me with this:
I want to have an JAAS Login Module to authenticate users on my struts web application. I use a LogonForm.
The problem is that lc cannot find the login module because it cannot find the coresponding configuration file. I do not know how to resolve
this. I have put the config file that it is called myapp.conf :
MyAppLoginModule
{
com.mycompany.stuff.security.MyAppLoginModule required debug=true;
};
in web-inf and then I tried to get it like this:
Properties p = System.getProperties();
ClassLoader c = this.getClass().getClassLoader();
System.err.println("class loader ok ");
String sc = cl.getResource ("/WEB-INF/myapp.conf").toString();
System.err.println("conf finded");
p.setProperty ("java.security.auth.login.config",sc);
but it throws an NullPointer Exception - getResource(), so it doesn't find it.
I think that I should put it somehow in web.xml, I tried like this:
<system-property java.security.auth.login.config="/WEB-INF/myapp.conf"/>
but nothing happend.
So, how should I do this?
regards,
whiteadi