Forum Stats

  • 3,817,474 Users
  • 2,259,340 Discussions
  • 7,893,791 Comments

Discussions

Jaas and Eclipse

Hi guys, I'm a new User in this forum. Thanks to all of them that will answer this post.
I'm a student and I have to create an Java secure application using Jaas. I'm working on Eclipse. I have some troubles with the policy file to assign the user roles.
this is the policy code :


grant Principal auth.SysAdminPrincipal "joetrotta"
{

// permission java.security.AllPermission;

// permission java.io.FilePermission "/Users/gtrotta89/Documents//chp02/foo.txt";

};

grant Principal LoginModule.UserPrincipal "dzobbe"
{

};


grant codebase "file:/Users/gtrotta89/Documents/workspace/JaasApp"{

permission java.lang.RuntimePermission "setSecurityManager";
permission java.lang.RuntimePermission "createSecurityManager";
permission java.net.SocketPermission "*", "connect";
permission javax.security.auth.AuthPermission "modifyPrincipals";
permission javax.security.auth.AuthPermission "modifyPublicCredentials";
permission javax.security.auth.AuthPermission "modifyPrivateCredentials";
permission javax.security.auth.AuthPermission "createLoginContext.*";
permission javax.security.auth.AuthPermission "doAs";
permission javax.security.auth.AuthPermission "doAsPrivileged";
permission java.security.SecurityPermission "setPolicy";
permission java.security.SecurityPermission "getPolicy";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.provider";
permission java.lang.RuntimePermission "getProtectionDomain";
};



Is that the correct way to implement jaas policy?
I didn't create the jars file and probably it can't find the correct Principal class (SysAdminPrincipal)
Please Help me I spent a week on that
This discussion has been closed.