diff --git a/dynamic_entity_reference.views.inc b/dynamic_entity_reference.views.inc
index d429d26..d0a6318 100644
--- a/dynamic_entity_reference.views.inc
+++ b/dynamic_entity_reference.views.inc
@@ -159,7 +159,7 @@ function dynamic_entity_reference_views_data() {
       // Filter out non SQL entity types because \Drupal\views\EntityViewsData
       // class only allows entities with
       // \Drupal\Core\Entity\Sql\SqlEntityStorageInterface.
-      $targets = array_intersect(DynamicEntityReferenceItem::getTargetTypes($field->getSettings()), array_keys($sql_entity_types));
+      $targets = array_intersect(DynamicEntityReferenceItem::getTargetTypes($field->getSettings(), TRUE), array_keys($sql_entity_types));
       foreach ($targets as $target_entity_type_id) {
         if ($entity_manager->hasHandler($target_entity_type_id, 'views_data')) {
           $target_entity_type = $entity_types[$target_entity_type_id];
diff --git a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
index 854bf1d..d7ac3e9 100644
--- a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
+++ b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
@@ -56,6 +56,10 @@ class DynamicEntityReferenceItem extends EntityReferenceItem {
     $default_settings = [];
     $labels = \Drupal::service('entity_type.repository')->getEntityTypeLabels(TRUE);
     $options = $labels[(string) t('Content', [], ['context' => 'Entity type group'])];
+
+    // Add configuration entities.
+    $options += $labels[(string) t('Configuration', [], ['context' => 'Entity type group'])];
+
     // Field storage settings are not accessible here so we are assuming that
     // all the entity types are referenceable by default.
     // See https://www.drupal.org/node/2346273#comment-9385179 for more details.
@@ -202,7 +206,8 @@ class DynamicEntityReferenceItem extends EntityReferenceItem {
 
     $settings_form = [];
     $settings = $this->getSettings();
-    foreach (static::getTargetTypes($settings) as $target_type) {
+    // Config entities are excluded from the UI.
+    foreach (static::getTargetTypes($settings, FALSE) as $target_type) {
       $entity_type = \Drupal::entityTypeManager()->getDefinition($target_type);
       $settings_form[$target_type] = $this->targetTypeFieldSettingsForm($form, $form_state, $target_type);
       $settings_form[$target_type]['handler']['#title'] = t('Reference type for @target_type', ['@target_type' => $entity_type->getLabel()]);
@@ -509,13 +514,21 @@ class DynamicEntityReferenceItem extends EntityReferenceItem {
    * @param array $settings
    *   The settings of the field storage.
    *
-   * @return string[]
-   *   All the target entity type ids that can be referenced.
+   * @param bool $include_configuration_entities
+   *   (optional) Include configuration entities. Defaults to FALSE.
+   *
+   * @return \string[] All the target entity type ids that can be referenced.
+   * All the target entity type ids that can be referenced.
    */
-  public static function getTargetTypes($settings) {
+  public static function getTargetTypes($settings, $include_configuration_entities = FALSE) {
     $labels = \Drupal::service('entity_type.repository')->getEntityTypeLabels(TRUE);
     $options = array_keys($labels[(string) t('Content', [], ['context' => 'Entity type group'])]);
 
+    // Add configuration entities.
+    if ($include_configuration_entities) {
+      $options = array_merge($options, array_keys($labels[(string) t('Configuration', [], ['context' => 'Entity type group'])]));
+    }
+
     if (!empty($settings['exclude_entity_types'])) {
       return array_diff($options, $settings['entity_type_ids'] ?: []);
     }
diff --git a/src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php
index 7568058..f606aa1 100644
--- a/src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php
+++ b/src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php
@@ -47,7 +47,7 @@ class DynamicEntityReferenceWidget extends EntityReferenceAutocompleteWidget {
 
     $settings = $this->getFieldSettings();
     $labels = \Drupal::entityManager()->getEntityTypeLabels();
-    $available = DynamicEntityReferenceItem::getTargetTypes($settings);
+    $available = DynamicEntityReferenceItem::getTargetTypes($settings, TRUE);
     $cardinality = $items->getFieldDefinition()->getFieldStorageDefinition()->getCardinality();
     $target_type = $items->get($delta)->target_type ?: reset($available);
 
diff --git a/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php b/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php
index 79a515c..66ce379 100644
--- a/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraintValidator.php
@@ -68,7 +68,7 @@ class ValidDynamicReferenceConstraintValidator extends ConstraintValidator imple
     $new_entities = [];
     $target_ids = [];
     $target_types = [];
-    $valid_target_types = DynamicEntityReferenceItem::getTargetTypes($value->getFieldDefinition()->getSettings());
+    $valid_target_types = DynamicEntityReferenceItem::getTargetTypes($value->getFieldDefinition()->getSettings(), TRUE);
     foreach ($value as $delta => $item) {
       // We don't use a regular NotNull constraint for the target_id property as
       // NULL is allowed if the entity property contains an unsaved entity.
diff --git a/tests/src/Functional/DynamicEntityReferenceTest.php b/tests/src/Functional/DynamicEntityReferenceTest.php
index 42e7448..b5d40ae 100644
--- a/tests/src/Functional/DynamicEntityReferenceTest.php
+++ b/tests/src/Functional/DynamicEntityReferenceTest.php
@@ -47,6 +47,7 @@ class DynamicEntityReferenceTest extends BrowserTestBase {
     'field_ui',
     'dynamic_entity_reference',
     'entity_test',
+    'config_test',
   ];
 
   /**
@@ -98,6 +99,13 @@ class DynamicEntityReferenceTest extends BrowserTestBase {
     $assert_session->fieldExists('default_value_input[field_foobar][0][target_type]');
     $assert_session->optionExists('default_value_input[field_foobar][0][target_type]', 'entity_test');
     $assert_session->optionNotExists('default_value_input[field_foobar][0][target_type]', 'user');
+
+    // Ensure no configuration entities are exposed to the UI.
+    $labels = $this->container->get('entity_type.repository')->getEntityTypeLabels(TRUE);
+    foreach (array_keys($labels[(string) t('Configuration')]) as $entity_type) {
+      $assert_session->fieldNotExists('settings[' . $entity_type . '][handler]');
+    }
+
     $edit = [
       'settings[entity_test_label][handler_settings][target_bundles][entity_test_label]' => TRUE,
       'settings[entity_test_view_builder][handler_settings][target_bundles][entity_test_view_builder]' => TRUE,
@@ -459,7 +467,6 @@ class DynamicEntityReferenceTest extends BrowserTestBase {
     $assert_session->pageTextContains($this->adminUser->label());
     $assert_session->pageTextContains('tag');
     $assert_session->pageTextContains($term->label());
-
   }
 
   /**
diff --git a/tests/src/Functional/DynamicEntityReferenceWidgetTest.php b/tests/src/Functional/DynamicEntityReferenceWidgetTest.php
index d1b8ceb..fbc3b58 100644
--- a/tests/src/Functional/DynamicEntityReferenceWidgetTest.php
+++ b/tests/src/Functional/DynamicEntityReferenceWidgetTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\dynamic_entity_reference\Functional;
 
 use Drupal\Component\Utility\Unicode;
+use Drupal\config_test\Entity\ConfigTest;
 use Drupal\Core\Entity\Entity\EntityFormDisplay;
 use Drupal\Core\Url;
 use Drupal\field\Entity\FieldConfig;
@@ -39,6 +40,7 @@ class DynamicEntityReferenceWidgetTest extends BrowserTestBase {
     'dynamic_entity_reference',
     'field_ui',
     'node',
+    'config_test',
   ];
 
   /**
@@ -76,6 +78,7 @@ class DynamicEntityReferenceWidgetTest extends BrowserTestBase {
         'exclude_entity_types' => FALSE,
         'entity_type_ids' => [
           'node',
+          'config_test',
         ],
       ],
     ]);
@@ -91,6 +94,10 @@ class DynamicEntityReferenceWidgetTest extends BrowserTestBase {
             'sort' => ['field' => '_none'],
           ],
         ],
+        'config_test' => [
+          'handler' => 'default',
+          'handler_settings' => [],
+        ],
       ],
     ])->save();
     $this->fieldName = $field_name;
@@ -126,6 +133,27 @@ class DynamicEntityReferenceWidgetTest extends BrowserTestBase {
     $reference_node = reset($nodes);
     $this->assertEquals($reference_node->get($field_name)->offsetGet(0)->target_type, $referenced_node->getEntityTypeId());
     $this->assertEquals($reference_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id());
+
+    // Test with config entity.
+    $referenced_entity = $this->container->get('entity_type.manager')->getStorage('config_test')->create(['label' => $this->randomString(), 'id' => Unicode::strtolower($this->randomMachineName())]);
+    $referenced_entity->save();
+
+    $title = $this->randomMachineName();
+    $edit = [
+      'title[0][value]' => $title,
+      $field_name . '[0][target_type]' => $referenced_entity->getEntityTypeId(),
+      $field_name . '[0][target_id]' => $referenced_entity->label() . ' (' . $referenced_entity->id() . ')',
+    ];
+    $this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'reference_content']));
+    $this->submitForm($edit, t('Save'));
+    $node = $this->drupalGetNodeByTitle($title);
+    $assert_session->responseContains(t('@type %title has been created.', ['@type' => 'reference_content', '%title' => $node->toLink($node->label())->toString()]));
+    $nodes = \Drupal::entityTypeManager()
+      ->getStorage('node')
+      ->loadByProperties(['title' => $title]);
+    $reference_node = reset($nodes);
+    $this->assertEquals($referenced_entity->getEntityTypeId(), $reference_node->get($field_name)->offsetGet(0)->target_type);
+    $this->assertEquals($referenced_entity->id(), $reference_node->get($field_name)->offsetGet(0)->target_id);
   }
 
   /**
diff --git a/tests/src/Kernel/DynamicEntityReferenceConfigEntityBaseFieldTest.php b/tests/src/Kernel/DynamicEntityReferenceConfigEntityBaseFieldTest.php
new file mode 100644
index 0000000..c1d84a1
--- /dev/null
+++ b/tests/src/Kernel/DynamicEntityReferenceConfigEntityBaseFieldTest.php
@@ -0,0 +1,222 @@
+<?php
+
+namespace Drupal\Tests\dynamic_entity_reference\Kernel;
+
+use Drupal\Component\Utility\Unicode;
+use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
+
+/**
+ * Base field tests for referencing config entities.
+ *
+ * @group dynamic_entity_reference
+ */
+class DynamicEntityReferenceConfigEntityBaseFieldTest extends EntityKernelTestBase {
+
+  /**
+   * The entity type used in this test.
+   *
+   * @var string
+   */
+  protected $entityType = 'entity_test';
+
+  /**
+   * The entity type that is being referenced.
+   *
+   * @var string[]
+   */
+  protected $referencedEntityTypes = [
+    'config_test',
+  ];
+
+  /**
+   * The bundle used in this test.
+   *
+   * @var string
+   */
+  protected $bundle = 'entity_test';
+
+  /**
+   * The name of the field used in this test.
+   *
+   * @var string
+   */
+  protected $fieldName = 'dynamic_references';
+
+  /**
+   * The state service.
+   *
+   * @var \Drupal\Core\State\StateInterface
+   */
+  protected $state;
+
+  /**
+   * A config entity to reference.
+   *
+   * @var \Drupal\config_test\ConfigTestInterface
+   */
+  protected $configTestReference;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['config_test', 'dynamic_entity_reference'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->installConfig(['config_test']);
+    $this->installEntitySchema('entity_test_rev');
+
+    $this->state = $this->container->get('state');
+
+    // Setup some states for controlling the base field configuration.
+    // @see dynamic_entity_reference_entity_test_entity_base_field_info()
+    $this->state->set('dynamic_entity_reference_entity_test_cardinality', 1);
+    $this->state->set('dynamic_entity_reference_entity_test_entities', [$this->entityType, 'config_test']);
+    $this->state->set('dynamic_entity_reference_entity_test_exclude', [$this->entityType]);
+
+    // Add a config entity for referencing.
+    $this->configTestReference = $this->container->get('entity_type.manager')
+      ->getStorage('config_test')
+      ->create([
+        'id' => Unicode::strtolower($this->randomMachineName()),
+        'label' => $this->randomString(),
+        'style' => Unicode::strtolower($this->randomMachineName()),
+      ]);
+    $this->configTestReference->save();
+  }
+
+  /**
+   * Config entity only base DER field.
+   */
+  public function testBaseField() {
+    // @see dynamic_entity_reference_entity_test_entity_base_field_info()
+    $this->enableModules(['dynamic_entity_reference_entity_test']);
+    $this->container->get('entity.definition_update_manager')->applyUpdates();
+
+    // Reference a config entity.
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+  }
+
+  /**
+   * Config entity only revisionable base DER field.
+   */
+  public function testRevisionableBaseField() {
+    // @see dynamic_entity_reference_entity_test_entity_base_field_info()
+
+    // Make this base field revisionable.
+    $this->state->set('dynamic_entity_reference_entity_test_revisionable', TRUE);
+    $this->enableModules(['dynamic_entity_reference_entity_test']);
+    $this->container->get('entity.definition_update_manager')->applyUpdates();
+
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+
+    // Save the entity and update.
+    $entity->save();
+    $referenced_entity = $this->container->get('entity_type.manager')
+      ->getStorage('config_test')
+      ->create([
+        'id' => 'bar',
+        'label' => 'Bar',
+        'style' => 'foo',
+      ]);
+    $referenced_entity->save();
+    $entity->{$this->fieldName}->target_type = $referenced_entity->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $referenced_entity->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+    $entity->save();
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->load($entity->id());
+    $referenced = $entity->{$this->fieldName}->referencedEntities();
+    $this->assertEquals(1, count($referenced));
+    $this->assertEquals('bar', $referenced[0]->id());
+  }
+
+  /**
+   * Content entity and config entity base DER field.
+   */
+  public function testMixedBaseField() {
+    // @see dynamic_entity_reference_entity_test_entity_base_field_info()
+    $this->state->set('dynamic_entity_reference_entity_test_entities', [$this->entityType, 'config_test', 'entity_test_mul']);
+    $this->enableModules(['dynamic_entity_reference_entity_test']);
+    $this->container->get('entity.definition_update_manager')->applyUpdates();
+
+    // Reference a config entity.
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+
+    // Reference a content entity.
+    $referenced_entity = $this->container->get('entity_type.manager')
+      ->getStorage('entity_test_mul')
+      ->create(['type' => $this->bundle]);
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $referenced_entity->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $referenced_entity->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+  }
+
+  /**
+   * Content entity and config entity revisionable base DER field.
+   */
+  public function testMixedRevisionableBaseField() {
+    // @see dynamic_entity_reference_entity_test_entity_base_field_info()
+    // Make this base field revisionable.
+    $this->state->set('dynamic_entity_reference_entity_test_revisionable', TRUE);
+    $this->state->set('dynamic_entity_reference_entity_test_entities', [$this->entityType, 'config_test', 'entity_test_mul']);
+    $this->enableModules(['dynamic_entity_reference_entity_test']);
+    $this->container->get('entity.definition_update_manager')->applyUpdates();
+
+    // Reference a config entity.
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+
+    // Save the entity and update to use a content entity.
+    $entity->save();
+    $referenced_entity = $this->container->get('entity_type.manager')
+      ->getStorage('entity_test_mul')
+      ->create(['type' => $this->bundle]);
+    $referenced_entity->save();
+    $entity->{$this->fieldName}->target_type = $referenced_entity->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $referenced_entity->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+    $entity->save();
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->load($entity->id());
+    $referenced = $entity->{$this->fieldName}->referencedEntities();
+    $this->assertEquals(1, count($referenced));
+    $this->assertEquals($referenced_entity->id(), $referenced[0]->id());
+  }
+
+}
diff --git a/tests/src/Kernel/DynamicEntityReferenceConfigEntityTest.php b/tests/src/Kernel/DynamicEntityReferenceConfigEntityTest.php
new file mode 100644
index 0000000..3ccee3c
--- /dev/null
+++ b/tests/src/Kernel/DynamicEntityReferenceConfigEntityTest.php
@@ -0,0 +1,248 @@
+<?php
+
+namespace Drupal\Tests\dynamic_entity_reference\Kernel;
+
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
+
+/**
+ * Tests for referencing configuration entities with configurable fields.
+ *
+ * @group dynamic_entity_reference
+ */
+class DynamicEntityReferenceConfigEntityTest extends EntityKernelTestBase {
+
+  /**
+   * The entity type used in this test.
+   *
+   * @var string
+   */
+  protected $entityType = 'entity_test';
+
+  /**
+   * The entity type that is being referenced.
+   *
+   * @var string[]
+   */
+  protected $referencedEntityTypes = [
+    'config_test',
+  ];
+
+  /**
+   * The bundle used in this test.
+   *
+   * @var string
+   */
+  protected $bundle = 'entity_test';
+
+  /**
+   * The name of the field used in this test.
+   *
+   * @var string
+   */
+  protected $fieldName = 'field_test';
+
+  /**
+   * Field storage.
+   *
+   * @var \Drupal\field\FieldStorageConfigInterface
+   */
+  protected $fieldStorage;
+
+  /**
+   * Field config.
+   *
+   * @var \Drupal\field\FieldConfigInterface
+   */
+  protected $fieldConfig;
+
+  /**
+   * A config entity to reference.
+   *
+   * @var \Drupal\config_test\ConfigTestInterface
+   */
+  protected $configTestReference;
+
+  /**
+   * A content entity for referencing.
+   *
+   * @var \Drupal\entity_test\Entity\EntityTest
+   */
+  protected $contentEntityReference;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['config_test', 'dynamic_entity_reference'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->installConfig(['config_test']);
+    $this->installEntitySchema('entity_test_rev');
+    $this->installEntitySchema('entity_test_string_id');
+
+    $this->configTestReference = $this->container->get('entity_type.manager')
+      ->getStorage('config_test')
+      ->create([
+        'id' => 'foo',
+        'label' => 'Foo',
+        'style' => 'bar',
+      ]);
+    $this->configTestReference->save();
+
+    $this->contentEntityReference = $this->container->get('entity_type.manager')
+      ->getStorage('entity_test_rev')
+      ->create(['type' => $this->bundle]);
+    $this->contentEntityReference->save();
+  }
+
+  /**
+   * Helper method to setup field and field storages.
+   */
+  protected function setUpField() {
+    // Create a field.
+    $this->fieldStorage = FieldStorageConfig::create([
+      'field_name' => $this->fieldName,
+      'type' => 'dynamic_entity_reference',
+      'entity_type' => $this->entityType,
+      'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
+      'settings' => [
+        'exclude_entity_types' => FALSE,
+        'entity_type_ids' => $this->referencedEntityTypes,
+      ],
+    ]);
+    $this->fieldStorage->save();
+
+    $settings = [];
+    foreach ($this->referencedEntityTypes as $entity_type_id) {
+      $settings[$entity_type_id] = [
+        'handler' => "default:$entity_type_id",
+        'handler_settings' => [],
+      ];
+    }
+    $this->fieldConfig = FieldConfig::create([
+      'field_name' => $this->fieldName,
+      'entity_type' => $this->entityType,
+      'bundle' => $this->bundle,
+      'label' => 'Field test',
+      'settings' => $settings,
+    ]);
+    $this->fieldConfig->save();
+  }
+
+  /**
+   * Config entity only configurable DER field.
+   */
+  public function testConfigurableField() {
+    $this->setUpField();
+
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEquals($violations->count(), 0, 'Validation passes.');
+  }
+
+  /**
+   * Content entity (int ID) and config entity configurable DER field.
+   */
+  public function testMixedConfigurableField() {
+    $this->referencedEntityTypes[] = 'entity_test_rev';
+    $this->setUpField();
+
+    // Check config entity.
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+
+    // Check content entity.
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->contentEntityReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->contentEntityReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+  }
+
+  /**
+   * String-ID content entity and config entity.
+   */
+  public function testMixedConfigurableFieldStringId() {
+    $this->referencedEntityTypes[] = 'entity_test_string_id';
+    $this->setUpField();
+
+    // Check config entity.
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+
+    // Check content entity (string ID).
+    $referenced_entity = $this->container->get('entity_type.manager')
+      ->getStorage('entity_test_string_id')
+      ->create(['type' => $this->bundle]);
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $referenced_entity->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $referenced_entity->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+  }
+
+  /**
+   * Mixed content entity IDs (string and int) and config entity.
+   */
+  public function testMixedConfigurableFieldMixedIds() {
+    $this->referencedEntityTypes[] = 'entity_test_rev';
+    $this->referencedEntityTypes[] = 'entity_test_string_id';
+    $this->setUpField();
+
+    // Check config entity.
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->configTestReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->configTestReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+
+    // Check content entity (string ID).
+    $referenced_entity = $this->container->get('entity_type.manager')
+      ->getStorage('entity_test_string_id')
+      ->create(['type' => $this->bundle]);
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $referenced_entity->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $referenced_entity->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+
+    // Check content entity (int ID).
+    $entity = $this->container->get('entity_type.manager')
+      ->getStorage($this->entityType)
+      ->create(['type' => $this->bundle]);
+    $entity->{$this->fieldName}->target_type = $this->contentEntityReference->getEntityTypeId();
+    $entity->{$this->fieldName}->target_id = $this->contentEntityReference->id();
+    $violations = $entity->{$this->fieldName}->validate();
+    $this->assertEmpty($violations->count(), 'Validation passes.');
+  }
+
+}
