Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAAS and struts

843834Oct 1 2002 — edited Nov 11 2002
Someone 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2002
Added on Oct 1 2002
4 comments
127 views