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;
}
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;
}
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);
}
Aggregations