newControllers.add(target.addService(SecurityBootstrapService.SERVICE_NAME, bootstrapService)
.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, bootstrapService.getServiceModuleLoaderInjectedValue())
.addListener(verificationHandler)
.setInitialMode(ServiceController.Mode.ACTIVE).install());
context.addStep(new AbstractDeploymentChainStep() {
protected void execute(DeploymentProcessorTarget processorTarget) {
}
}, OperationContext.Stage.RUNTIME);
// add service to bind SecurityDomainJndiInjectable to JNDI
final SecurityDomainJndiInjectable securityDomainJndiInjectable = new SecurityDomainJndiInjectable();
final BinderService binderService = new BinderService("jaas");
newControllers.add(target.addService(ContextNames.JBOSS_CONTEXT_SERVICE_NAME.append("jaas"), binderService)
.addInjection(binderService.getManagedObjectInjector(), securityDomainJndiInjectable)
.addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addDependency(SecurityManagementService.SERVICE_NAME, ISecurityManagement.class, securityDomainJndiInjectable.getSecurityManagementInjector())
.addListener(verificationHandler)
.setInitialMode(ServiceController.Mode.ACTIVE).install());
// add security management service
ModelNode modelNode = model.get(Constants.DEEP_COPY_SUBJECT_MODE);
final SecurityManagementService securityManagementService = new SecurityManagementService(
AUTHENTICATION_MANAGER, modelNode.isDefined() && modelNode.asBoolean(), CALLBACK_HANDLER,
AUTHORIZATION_MANAGER, AUDIT_MANAGER, IDENTITY_TRUST_MANAGER, MAPPING_MANAGER);
newControllers.add(target.addService(SecurityManagementService.SERVICE_NAME, securityManagementService)
.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, securityManagementService.getServiceModuleLoaderInjectedValue())
.addListener(verificationHandler)
.setInitialMode(ServiceController.Mode.ACTIVE).install());
// add subject factory service
final SubjectFactoryService subjectFactoryService = new SubjectFactoryService(SUBJECT_FACTORY);
newControllers.add(target.addService(SubjectFactoryService.SERVICE_NAME, subjectFactoryService)
.addDependency(SecurityManagementService.SERVICE_NAME, ISecurityManagement.class,
subjectFactoryService.getSecurityManagementInjector())
.addListener(verificationHandler)
.setInitialMode(ServiceController.Mode.ACTIVE).install());
// add jaas configuration service
Configuration loginConfig = XMLLoginConfigImpl.getInstance();
final JaasConfigurationService jaasConfigurationService = new JaasConfigurationService(loginConfig);
newControllers.add(target.addService(JaasConfigurationService.SERVICE_NAME, jaasConfigurationService)
.addListener(verificationHandler).setInitialMode(ServiceController.Mode.ACTIVE).install());
//add Simple Security Manager Service
final SimpleSecurityManagerService simpleSecurityManagerService = new SimpleSecurityManagerService();
newControllers.add(target.addService(SimpleSecurityManagerService.SERVICE_NAME, simpleSecurityManagerService)
.addDependency(SecurityManagementService.SERVICE_NAME, ISecurityManagement.class,
simpleSecurityManagerService.getSecurityManagementInjector())
.addListener(verificationHandler).install());
context.addStep(new AbstractDeploymentChainStep() {
protected void execute(DeploymentProcessorTarget processorTarget) {
processorTarget.addDeploymentProcessor(Phase.INSTALL, Phase.INSTALL_JACC_POLICY,
new JaccEarDeploymentProcessor());
processorTarget.addDeploymentProcessor(Phase.DEPENDENCIES, Phase.DEPENDENCIES_SECURITY,
new SecurityDependencyProcessor());