• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Executing JAAS code using a signed applet

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Master Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic