Search in sources :

Example 1 with IdentityTrustModuleEntry

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;
}
Also used : IdentityTrustModuleEntry(org.jboss.security.identitytrust.config.IdentityTrustModuleEntry) IdentityTrustInfo(org.jboss.security.config.IdentityTrustInfo) ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property) ControlFlag(org.jboss.security.config.ControlFlag) LoginModuleControlFlag(javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag)

Aggregations

LoginModuleControlFlag (javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag)1 ModelNode (org.jboss.dmr.ModelNode)1 Property (org.jboss.dmr.Property)1 ControlFlag (org.jboss.security.config.ControlFlag)1 IdentityTrustInfo (org.jboss.security.config.IdentityTrustInfo)1 IdentityTrustModuleEntry (org.jboss.security.identitytrust.config.IdentityTrustModuleEntry)1