Search in sources :

Example 1 with NameIdConfig

use of org.xdi.config.oxtrust.NameIdConfig in project oxTrust by GluuFederation.

the class ConfigureNameIdAction method init.

public String init() {
    if (initialized) {
        return OxTrustConstants.RESULT_SUCCESS;
    }
    this.attributes = attributeService.getAllAttributes();
    final LdapOxTrustConfiguration conf = configurationFactory.loadConfigurationFromLdap("oxTrustConfAttributeResolver");
    if (conf == null) {
        log.error("Failed to load oxTrust configuration");
        return OxTrustConstants.RESULT_FAILURE;
    }
    this.nameIdConfigs = new ArrayList<NameIdConfig>();
    AttributeResolverConfiguration attributeResolverConfiguration = conf.getAttributeResolverConfig();
    if ((attributeResolverConfiguration != null) && (attributeResolverConfiguration.getNameIdConfigs() != null)) {
        for (NameIdConfig nameIdConfig : attributeResolverConfiguration.getNameIdConfigs()) {
            this.nameIdConfigs.add(nameIdConfig);
        }
    }
    this.initialized = true;
    return OxTrustConstants.RESULT_SUCCESS;
}
Also used : LdapOxTrustConfiguration(org.xdi.config.oxtrust.LdapOxTrustConfiguration) AttributeResolverConfiguration(org.xdi.config.oxtrust.AttributeResolverConfiguration) NameIdConfig(org.xdi.config.oxtrust.NameIdConfig)

Example 2 with NameIdConfig

use of org.xdi.config.oxtrust.NameIdConfig in project oxTrust by GluuFederation.

the class Shibboleth3ConfService method initAttributeResolverParamMap.

public HashMap<String, Object> initAttributeResolverParamMap() {
    HashMap<String, Object> attributeResolverParams = new HashMap<String, Object>();
    List<NameIdConfig> nameIdConfigs = new ArrayList<NameIdConfig>();
    Map<String, GluuAttribute> nameIdAttributes = new HashMap<String, GluuAttribute>();
    final LdapOxTrustConfiguration conf = configurationFactory.loadConfigurationFromLdap();
    AttributeResolverConfiguration attributeResolverConfiguration = conf.getAttributeResolverConfig();
    if ((attributeResolverConfiguration != null) && (attributeResolverConfiguration.getNameIdConfigs() != null)) {
        for (NameIdConfig nameIdConfig : attributeResolverConfiguration.getNameIdConfigs()) {
            if (StringHelper.isNotEmpty(nameIdConfig.getSourceAttribute()) && nameIdConfig.isEnabled()) {
                String attributeName = nameIdConfig.getSourceAttribute();
                GluuAttribute attribute = attributeService.getAttributeByName(attributeName);
                nameIdConfigs.add(nameIdConfig);
                nameIdAttributes.put(attributeName, attribute);
            }
        }
    }
    attributeResolverParams.put("configs", nameIdConfigs);
    attributeResolverParams.put("attributes", nameIdAttributes);
    return attributeResolverParams;
}
Also used : LdapOxTrustConfiguration(org.xdi.config.oxtrust.LdapOxTrustConfiguration) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AttributeResolverConfiguration(org.xdi.config.oxtrust.AttributeResolverConfiguration) NameIdConfig(org.xdi.config.oxtrust.NameIdConfig) GluuAttribute(org.xdi.model.GluuAttribute)

Example 3 with NameIdConfig

use of org.xdi.config.oxtrust.NameIdConfig in project oxTrust by GluuFederation.

the class ConfigureNameIdAction method addNameIdConfig.

public void addNameIdConfig() {
    NameIdConfig nameIdConfig = new NameIdConfig();
    this.nameIdConfigs.add(nameIdConfig);
}
Also used : NameIdConfig(org.xdi.config.oxtrust.NameIdConfig)

Aggregations

NameIdConfig (org.xdi.config.oxtrust.NameIdConfig)3 AttributeResolverConfiguration (org.xdi.config.oxtrust.AttributeResolverConfiguration)2 LdapOxTrustConfiguration (org.xdi.config.oxtrust.LdapOxTrustConfiguration)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 GluuAttribute (org.xdi.model.GluuAttribute)1