use of org.jboss.security.identitytrust.config.IdentityTrustModuleEntry in project wildfly by wildfly.
the class SecurityDomainAdd method processIdentityTrust.
private boolean processIdentityTrust(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException {
node = peek(node, IDENTITY_TRUST, CLASSIC, TRUST_MODULE);
if (node == null) {
return false;
}
IdentityTrustInfo identityTrustInfo = new IdentityTrustInfo(securityDomain);
for (Property moduleProperty : node.asPropertyList()) {
ModelNode module = moduleProperty.getValue();
String codeName = LoginModuleResourceDefinition.CODE.resolveModelAttribute(context, module).asString();
String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString();
ControlFlag controlFlag = ControlFlag.valueOf(flag);
Map<String, Object> options = extractOptions(context, module);
IdentityTrustModuleEntry entry = new IdentityTrustModuleEntry(codeName, options);
entry.setControlFlag(controlFlag);
identityTrustInfo.add(entry);
ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && !moduleName.asString().isEmpty()) {
identityTrustInfo.addJBossModuleName(moduleName.asString());
} else {
identityTrustInfo.addJBossModuleName(DEFAULT_MODULE);
}
}
applicationPolicy.setIdentityTrustInfo(identityTrustInfo);
return true;
}
Aggregations