File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes Executing JAAS code using a signed applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Executing JAAS code using a signed applet" Watch "Executing JAAS code using a signed applet" New topic
Author

Executing JAAS code using a signed applet

Deepak MP
Greenhorn

Joined: Dec 01, 2002
Posts: 11
I am trying NTAuthentication using JAAS. I have a signed applet in a JSP page which will run at the client and execute JAAS code. Login class using LoginContext is in a jar file. Applet is able to locate the configuration file, but is not able to read the configuration entry i.e "NTLogin".
Following is the part of code & exception :
**Part of Login Class
--
login() method
LoginContext lc = new LoginContext("NTLogin", new LoginCallbackHandler());
-----------------------
**Entry in the login configuration file is ::
NTLogin
{
com.ntlogin.auth.test.NTtest required returnNames=true returnSIDs=false;
};
-----------------------
** Part of applet code
Login() mLogin = new Login();
System.setProperty("login.config.url.1", "file:C:/local/tomcat/webapps/examples/myexample.login");
mLogin.login();
// login method is called thru JavaScript in the JSP page.
-------------------

Exception as :
java.lang.SecurityException : Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.<init>
Caused by: java.io.IOException : Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java : 206)
at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java : 95)
---------------------------
Can anyone suggest how to execute JAAS code using an applet.
Regards,
DEEPAK
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41839
    
  63
Some ideas:
- set the system property first thing, before you perform any JAAS action
- add some test code to the applet to make sure it can read the myexample.login file in that directory
- I don't know what JavaScript has to do with this ("login method is called thru JavaScript in the JSP page."), so I don't think I understand how this is supposed to work


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing JAAS code using a signed applet