Search in sources :

Example 1 with NameIdConfig

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

the class ConfigureNameIdAction method init.

public String init() {
    loadNameIds();
    this.attributes = attributeService.getAllAttributes();
    this.nameIdConfigs = new ArrayList<NameIdConfig>();
    AttributeResolverConfiguration attributeResolverConfiguration = configurationFactory.getAttributeResolverConfiguration();
    if ((attributeResolverConfiguration != null) && (attributeResolverConfiguration.getNameIdConfigs() != null)) {
        this.usedNamedIds.clear();
        for (NameIdConfig nameIdConfig : attributeResolverConfiguration.getNameIdConfigs()) {
            this.nameIdConfigs.add(nameIdConfig);
            this.usedNamedIds.put(nameIdConfig.getNameIdType(), nameIdConfig.getNameIdType());
        }
    }
    return OxTrustConstants.RESULT_SUCCESS;
}
Also used : AttributeResolverConfiguration(org.gluu.config.oxtrust.AttributeResolverConfiguration) NameIdConfig(org.gluu.config.oxtrust.NameIdConfig)

Example 2 with NameIdConfig

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

the class Shibboleth3ConfService method initAttributeResolverParamMap.

public HashMap<String, Object> initAttributeResolverParamMap() {
    List<NameIdConfig> nameIdConfigs = new ArrayList<NameIdConfig>();
    Set<GluuAttribute> nameIdAttributes = new HashSet<GluuAttribute>();
    AttributeResolverConfiguration attributeResolverConfiguration = configurationFactory.getAttributeResolverConfiguration();
    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.add(attribute);
            }
        }
    }
    HashMap<String, Object> attributeResolverParams = createAttributeMap(nameIdAttributes);
    attributeResolverParams.put("configs", nameIdConfigs);
    attributeResolverParams.put("attributes", nameIdAttributes);
    String baseUserDn = personService.getDnForPerson(null);
    String persistenceType = persistenceEntryManager.getPersistenceType(baseUserDn);
    log.debug(">>>>>>>>>> Shibboleth3ConfService.initAttributeResolverParamMap() - Persistance type: '{}'", persistenceType);
    attributeResolverParams.put("persistenceType", persistenceType);
    return attributeResolverParams;
}
Also used : ArrayList(java.util.ArrayList) AttributeResolverConfiguration(org.gluu.config.oxtrust.AttributeResolverConfiguration) NameIdConfig(org.gluu.config.oxtrust.NameIdConfig) GluuAttribute(org.gluu.model.GluuAttribute) HashSet(java.util.HashSet)

Example 3 with NameIdConfig

use of org.gluu.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.gluu.config.oxtrust.NameIdConfig)

Aggregations

NameIdConfig (org.gluu.config.oxtrust.NameIdConfig)3 AttributeResolverConfiguration (org.gluu.config.oxtrust.AttributeResolverConfiguration)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 GluuAttribute (org.gluu.model.GluuAttribute)1