I am trying to develop CustomPermission class in JAAS by extending BasicPermission class.
When i try to using this cusotmpermission class in JAAS Policy file and i try to read the permissions as below
...
ProtectionDomain domain =
new ProtectionDomain(cs, null,SimpleAuthz.class.getClassLoader(),principals);
....
....
PermissionCollection pcoll = Policy.getPolicy().getPermissions(domain);
Enumeration pcollEnum = pcoll.elements();
I iterate through the enumeration and print out the permissions. It says unresolved for my CustomPermission class even though i have put this class file in the jar file.
RESOURCE NAME.......5::com.gabhart.security.PageLevelAuthPermission
ACTIONS.............5::
PERMISSION..........5:
unresolved com.gabhart.security.PageLevelAuthPermission
btnUpdate disable)
If i dont provide this class file in jar i was getting NoClassDefFound, now it doesnt so that means it is able to access the class file, but still says its not resovled. I suspect there should be a way of regsitering this class with Java Security or my approach is wrong.
Please provide me your valuable inputs in using JAAS Custom Permission class in JAAS Policy file. Please provide me steps to do the same.