0 Replies Latest reply: Feb 14, 2013 5:26 AM by 991078 RSS

    Jaas and Eclipse

    991078
      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