• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAAS Error

 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I created a sample JAAS application. When I execute the code I get
Exception in thread "main" java.security.AccessControlException: access denied (javax.security.auth.AuthPermission createLoginContext.chp02) error

I get this error when I call logincontextobject.Login();

Policy File:
grant Principal chp02.UserPrincipal "user"
{
// not granted anything
};
grant Principal chp02.SysAdminPrincipal "sysadmin"
{
permission java.io.FilePermission "conf/chp02.policy", "read";
};

Configuration File

chp02
{
chp02.auth.SimpleLoginModule REQUIRED;
};

Can someone help

Thanks
Shashank
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your post seems to contain the answer to your question already: the user running the application needs to have the "AuthPermission createLoginContext.chp02" permission.
 
Nikhil Jain
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how do I give him the permission. I am using JAAS for the first time. I am doing a tutorial, which has not mentioned anything about this permission

javax.security.auth.AuthPermission

thanks

shashank
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably by adding a line like



to the "user" and "sysadmin" entries in the policy file. Once that works, other permissions may also be needed; have a look at the javadocs of the AuthPermission class for more detail.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic