Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Policy files

843811Jul 26 2001 — edited Jul 27 2001
Hello,

Anyone with experience with policy files?

I have this ibn a policy file. I load it using the property :
-Djava.security.auth.login.config=D:\pathh\...\raul_jaas.cfg

And in the policy file is:

grant Principal NTUserPrincipal "my_user_name"
{
permission com.mycomp.raul.RaulPermission "RaulPermissionName";
};

The access is denied all the time.
(Oh, I am using JAAS Nt modules for the LoginContext and Principals).

If I add:

permission com.mycomp.raul.RaulPermission "RaulPermissionName";

To the grant list of the java.policy then it works fine, I am allowed. But java.policy doesnt allow to include principals.


When I tried to get the permissions in the accessController, in the first case I dont get the perm, although if I make syntax errors in that policy file it complains "loudly".
In the second case, adding the permission to the java.policy it loads it like unresolved, but works fine after, when I call it.

Another solution that I didnt try yet, could be to create my own Policy implementation, that means use it instead sun.security.PolicyFile ( only one can survive ). I have to add my class, in this case, to the rt.jar or set the bootpath of the VM to the dir where it is.

Any help or comments?

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 24 2001
Added on Jul 26 2001
2 comments
81 views