Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executing JAAS code using a signed applet

 
Deepak MP
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic