• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

JAAS - two LoginModules - Getting a SecurityException : Help Needed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am trying a sample program with Client side JAAS Authentication.

With one login module my program works fine.

However,if I am trying to run the same test with two login modules namely,FirstLoginModule and SecondLoginModule.

My code works fine only when the secondLoginModule is set to "optional".

For all the other flags such as "Required","Requisite" I get the following exception.

javax.security.auth.login.LoginException: Security Exception
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:856)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:580)
at TestASAClient.main(TestASAClient.java:23)
Caused by: java.lang.SecurityException
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:857)
... 6 more
Cannot create LoginContext. Security Exception



My FirstLoginModules flags can be any.(Required/Requisite/Sufficient)



My config file is as follows.

/** Login Configuration for the JAAS Sample Application **/

testSample{
com.test.FirstLoginModule required debug=true;
com.test.SecondLoginModule required debug=true;
};


Appriciate your help in fixing this.

Thanks
 
Sheriff
Posts: 7041
1342
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"True JavaGuy" please check your private messages regarding an important administrative matter.
 
Anju Nadendla
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Easy..I got it..Nothing needs to be changed in the config file.
I goofed up something in my code itself.
 
reply
    Bookmark Topic Watch Topic
  • New Topic