/** * <p>Maps a specific {@link AttributedType}.</p> * * @param attributedType * * @return */ public LDAPMappingConfigurationBuilder mapping(Class<? extends AttributedType> attributedType) { return this.ldapStoreBuilder.mapping(attributedType); }
@Override protected LDAPIdentityStoreConfiguration create() { Map<Class<? extends AttributedType>, LDAPMappingConfiguration> mappingConfig = new HashMap<Class<? extends AttributedType>, LDAPMappingConfiguration>(); for (LDAPMappingConfigurationBuilder builder: this.mappingBuilders) { LDAPMappingConfiguration ldapMappingConfiguration = builder.create(); mappingConfig.put(ldapMappingConfiguration.getMappedClass(), ldapMappingConfiguration); } return new LDAPIdentityStoreConfiguration( this.url, this.connectionProperties, this.bindDN, this.bindCredential, this.baseDN, this.activeDirectory, this.pagination, this.uniqueIdentifierAttributeName, mappingConfig, getSupportedTypes(), getUnsupportedTypes(), getContextInitializers(), getCredentialHandlerProperties(), getCredentialHandlers(), isSupportCredentials()); }
.stores() .ldap() .connectionProperties(connectionProps) .addCredentialHandler(LDAPKeycloakCredentialHandler.class) .baseDN(ldapConfig.get(LDAPConstants.BASE_DN)) .bindDN(ldapConfig.get(LDAPConstants.BIND_DN)) .bindCredential(ldapConfig.get(LDAPConstants.BIND_CREDENTIAL)) .url(ldapConfig.get(LDAPConstants.CONNECTION_URL)) .activeDirectory(activeDirectory) .supportAllFeatures() .pagination(pagination); ldapStoreBuilder.uniqueIdentifierAttributeName("nsuniqueid"); } else if (LDAPConstants.VENDOR_TIVOLI.equals(vendor)) { ldapStoreBuilder.uniqueIdentifierAttributeName("uniqueidentifier"); .mapping(User.class) .baseDN(ldapConfig.get(LDAPConstants.USER_DN_SUFFIX)) .objectClasses(userObjectClasses)
storeConfig.url(url.asString()); storeConfig.bindDN(bindDn.asString()); storeConfig.bindCredential(bindCredential.asString()); storeConfig.baseDN(baseDn.asString()); storeConfig.uniqueIdentifierAttributeName(uniqueIdAttributeName.asString()); storeConfig.activeDirectory(activeDirectory.asBoolean()); .mapping(this.<AttributedType>loadClass(moduleNode, typeName)); ModelNode relatesToNode = LDAPStoreMappingResourceDefinition.RELATES_TO.resolveModelAttribute(context, ldapMapping);
storeConfig.url(url.asString()); storeConfig.bindDN(bindDn.asString()); storeConfig.bindCredential(bindCredential.asString()); storeConfig.baseDN(baseDn.asString()); storeMapping = storeConfig.mapping((Class<? extends AttributedType>) loadClass(alternativeModule, mappingClass)); } catch (ClassNotFoundException e) { throw new RuntimeException("Could not load LDAP mapped class [" + mappingClass + "].", e);
storeConfig.url(url.asString()); storeConfig.bindDN(bindDn.asString()); storeConfig.bindCredential(bindCredential.asString()); storeConfig.baseDN(baseDn.asString()); storeConfig.uniqueIdentifierAttributeName(uniqueIdAttributeName.asString()); storeConfig.activeDirectory(activeDirectory.asBoolean()); .mapping(this.<AttributedType>loadClass(moduleNode, typeName)); ModelNode relatesToNode = LDAPStoreMappingResourceDefinition.RELATES_TO.resolveModelAttribute(context, ldapMapping);
@Override protected LDAPIdentityStoreConfiguration create() { Map<Class<? extends AttributedType>, LDAPMappingConfiguration> mappingConfig = new HashMap<Class<? extends AttributedType>, LDAPMappingConfiguration>(); for (LDAPMappingConfigurationBuilder builder: this.mappingBuilders) { LDAPMappingConfiguration ldapMappingConfiguration = builder.create(); mappingConfig.put(ldapMappingConfiguration.getMappedClass(), ldapMappingConfiguration); } return new LDAPIdentityStoreConfiguration( this.url, this.connectionProperties, this.bindDN, this.bindCredential, this.baseDN, this.activeDirectory, this.pagination, this.uniqueIdentifierAttributeName, mappingConfig, getSupportedTypes(), getUnsupportedTypes(), getContextInitializers(), getCredentialHandlerProperties(), getCredentialHandlers(), isSupportCredentials()); }
/** * <p>Maps a specific {@link AttributedType}.</p> * * @param attributedType * * @return */ public LDAPMappingConfigurationBuilder mapping(Class<? extends AttributedType> attributedType) { return this.ldapStoreBuilder.mapping(attributedType); }
@Override protected LDAPStoreConfigurationBuilder readFrom(LDAPIdentityStoreConfiguration configuration) { super.readFrom(configuration); this.baseDN = configuration.getBaseDN(); this.bindCredential = configuration.getBindCredential(); this.bindDN = configuration.getBindDN(); this.url = configuration.getLdapURL(); this.activeDirectory = configuration.isActiveDirectory(); this.connectionProperties = configuration.getConnectionProperties(); this.pagination = configuration.isPagination(); this.uniqueIdentifierAttributeName = configuration.getUniqueIdentifierAttributeName(); for (Class<? extends AttributedType> attributedType: configuration.getMappingConfig().keySet()) { LDAPMappingConfiguration mappingConfiguration = configuration.getMappingConfig().get(attributedType); mapping(attributedType).readFrom(mappingConfiguration); } return this; } }
@Override protected LDAPStoreConfigurationBuilder readFrom(LDAPIdentityStoreConfiguration configuration) { super.readFrom(configuration); this.baseDN = configuration.getBaseDN(); this.bindCredential = configuration.getBindCredential(); this.bindDN = configuration.getBindDN(); this.url = configuration.getLdapURL(); this.activeDirectory = configuration.isActiveDirectory(); this.connectionProperties = configuration.getConnectionProperties(); this.pagination = configuration.isPagination(); this.uniqueIdentifierAttributeName = configuration.getUniqueIdentifierAttributeName(); for (Class<? extends AttributedType> attributedType: configuration.getMappingConfig().keySet()) { LDAPMappingConfiguration mappingConfiguration = configuration.getMappingConfig().get(attributedType); mapping(attributedType).readFrom(mappingConfiguration); } return this; } }