- URL url = getClass().getClassLoader().getResource(
- KernelConstants.JAAS_CONFIG);
- System.setProperty("java.security.auth.login.config",
- url.toExternalForm());
+ if (System.getProperty(KernelConstants.JAAS_CONFIG_PROP) == null) {
+ String jaasConfig = KernelConstants.JAAS_CONFIG;
+ URL url = getClass().getClassLoader().getResource(jaasConfig);
+ // System.setProperty(KernelConstants.JAAS_CONFIG_PROP,
+ // url.toExternalForm());
+ KernelUtils.setJaasConfiguration(url);
+ }
+ // explicitly load JAAS configuration
+ Configuration.getConfiguration();
+
+ // ConditionalPermissionAdmin permissionAdmin = bc
+ // .getService(bc.getServiceReference(ConditionalPermissionAdmin.class));
+ // ConditionalPermissionUpdate update =
+ // permissionAdmin.newConditionalPermissionUpdate();
+ // // Self
+ // update.getConditionalPermissionInfos()
+ // .add(permissionAdmin.newConditionalPermissionInfo(null,
+ // new ConditionInfo[] {
+ // new ConditionInfo(BundleLocationCondition.class.getName(), new
+ // String[] { "*" }) },
+ // new PermissionInfo[] { new
+ // PermissionInfo(AllPermission.class.getName(), null, null) },
+ // ConditionalPermissionInfo.ALLOW));
+ //