@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); // Next phase, need to detect if this is a Keycloak deployment. If not, don't add the modules. final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); addCommonModules(moduleSpecification, moduleLoader); addPlatformSpecificModules(moduleSpecification, moduleLoader); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (Configuration.INSTANCE.getSecureDeployment(deploymentUnit) == null) { WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); if (warMetaData == null) { return; } JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); if (webMetaData == null) { return; } LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); if (loginConfig == null) return; if (loginConfig.getAuthMethod() == null) return; if (!loginConfig.getAuthMethod().equals("KEYCLOAK-SAML")) return; } // Next phase, need to detect if this is a Keycloak deployment. If not, don't add the modules. final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); addCommonModules(moduleSpecification, moduleLoader); addPlatformSpecificModules(phaseContext, moduleSpecification, moduleLoader); }