diff --git a/modules/simple_ldap_sso/simple_ldap_sso.info.yml b/modules/simple_ldap_sso/simple_ldap_sso.info.yml
index 325f520..299ec45 100644
--- a/modules/simple_ldap_sso/simple_ldap_sso.info.yml
+++ b/modules/simple_ldap_sso/simple_ldap_sso.info.yml
@@ -1,6 +1,7 @@
 name: Simple LDAP SSO
 description: Single-Sign-On support for the Simple LDAP module.
 type: module
+core_version_requirement: ^8 || ^9
 configure: simple_ldap.sso
 core: 8.x
 package: LDAP
diff --git a/modules/simple_ldap_user/simple_ldap_user.info.yml b/modules/simple_ldap_user/simple_ldap_user.info.yml
index caafb67..f16ee6b 100644
--- a/modules/simple_ldap_user/simple_ldap_user.info.yml
+++ b/modules/simple_ldap_user/simple_ldap_user.info.yml
@@ -1,6 +1,7 @@
 name: Simple LDAP User
 description: Use the Simple LDAP server for User authentication.
 type: module
+core_version_requirement: ^8 || ^9
 configure: simple_ldap.user
 core: 8.x
 package: LDAP
diff --git a/modules/simple_ldap_user/simple_ldap_user.module b/modules/simple_ldap_user/simple_ldap_user.module
index 3725544..670463f 100644
--- a/modules/simple_ldap_user/simple_ldap_user.module
+++ b/modules/simple_ldap_user/simple_ldap_user.module
@@ -170,7 +170,7 @@ function simple_ldap_user_cron() {
   // Load all the users except anonymous and user #1.
   $users = User::loadMultiple();
   $users = array_filter($users, function (UserInterface $user) use ($authenticator) {
-    return $authenticator->canAuthenticate($user->getUsername());
+    return $authenticator->canAuthenticate($user->getAccountName());
   });
 
   /**
@@ -183,7 +183,7 @@ function simple_ldap_user_cron() {
   array_map(function (UserInterface $user) use ($manager, $syncer) {
     // Block the user if they are not found in the LDAP server.
     // TODO: Load all the LDAP users in a single request for better performance.
-    $ldap_user = $manager->getLdapUser($user->getUsername());
+    $ldap_user = $manager->getLdapUser($user->getAccountName());
     $was_blocked = $user->isBlocked();
     $force_save = FALSE;
     if ($ldap_user === FALSE) {
@@ -191,7 +191,7 @@ function simple_ldap_user_cron() {
         // There is an active drupal user, but no LDAP user associated. Block
         // the drupal user. The user base is **completely** managed by LDAP.
         \Drupal::logger('simple_ldap')->notice('Simple LDAP user cron blocking @name.', [
-          '@name' => $user->getUsername(),
+          '@name' => $user->getAccountName(),
         ]);
         $user->block();
         $user->save();
@@ -203,7 +203,7 @@ function simple_ldap_user_cron() {
       // The presence of an LDAP user is reason enough to unblock the Drupal
       // user.
       \Drupal::logger('simple_ldap')->notice('Simple LDAP user cron activating @name.', [
-        '@name' => $user->getUsername(),
+        '@name' => $user->getAccountName(),
       ]);
       $user->activate();
       $force_save = TRUE;
diff --git a/modules/simple_ldap_user/src/Form/SimpleLdapUserSettingsForm.php b/modules/simple_ldap_user/src/Form/SimpleLdapUserSettingsForm.php
index dd519fd..57fc018 100644
--- a/modules/simple_ldap_user/src/Form/SimpleLdapUserSettingsForm.php
+++ b/modules/simple_ldap_user/src/Form/SimpleLdapUserSettingsForm.php
@@ -65,7 +65,7 @@ class SimpleLdapUserSettingsForm extends ConfigFormBase {
       // If this is Active Directory, we lock the main attribute options.
       $readonly = ($this->server->getServerType() == 'Active Directory') ? TRUE : FALSE;
       if ($readonly) {
-        drupal_set_message($this->t('Your server is Active Directory, so some settings have been disabled.'), 'warning');
+        $this->messenger()->addWarning($this->t('Your server is Active Directory, so some settings have been disabled.'));
       }
 
       // If there is user input via an ajax callback, set it here
@@ -160,9 +160,8 @@ class SimpleLdapUserSettingsForm extends ConfigFormBase {
 
     }
     else {
-      drupal_set_message($this->t('There is a problem with your LDAP Server connection. As a result, this form has been disabled. Please <a href="@url">check your settings</a>.',
-        array('@url' => Url::fromRoute('simple_ldap.server')->toString())),
-        'warning');
+      $this->messenger()->addWarning($this->t('There is a problem with your LDAP Server connection. As a result, this form has been disabled. Please <a href="@url">check your settings</a>.',
+        array('@url' => Url::fromRoute('simple_ldap.server')->toString())));
     }
 
     return parent::buildForm($form, $form_state);
@@ -212,7 +211,7 @@ class SimpleLdapUserSettingsForm extends ConfigFormBase {
       try {
         $result = $this->schema->getAttributesByObjectClass($object_class);
         foreach ($result as $attribute) {
-          $attributes[Unicode::strtolower($attribute)] = $attribute;
+          $attributes[mb_strtolower($attribute)] = $attribute;
         }
       }
       catch (SimpleLdapException $e) {
diff --git a/modules/simple_ldap_user/src/SimpleLdapUserManager.php b/modules/simple_ldap_user/src/SimpleLdapUserManager.php
index 1020195..4168b40 100644
--- a/modules/simple_ldap_user/src/SimpleLdapUserManager.php
+++ b/modules/simple_ldap_user/src/SimpleLdapUserManager.php
@@ -7,7 +7,6 @@ use Drupal\simple_ldap\SimpleLdapException;
 use Drupal\simple_ldap\SimpleLdapServer;
 use Drupal\user\UserInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
-use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Config\ImmutableConfig;
 use Drupal\Core\Entity\EntityStorageException;
@@ -32,11 +31,6 @@ class SimpleLdapUserManager {
    */
   protected $config;
 
-  /**
-   * @var QueryFactory
-   */
-  protected $query;
-
   /**
    * @var EntityTypeManagerInterface
    */
@@ -47,10 +41,9 @@ class SimpleLdapUserManager {
    */
   protected $cache = [];
 
-  public function __construct(SimpleLdapServer $server, ConfigFactoryInterface $config_factory, QueryFactory $query, EntityTypeManagerInterface $entity_manager) {
+  public function __construct(SimpleLdapServer $server, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_manager) {
     $this->server = $server;
     $this->config = $config_factory->get('simple_ldap.user');
-    $this->query = $query;
     $this->entity_manager = $entity_manager;
   }
 
@@ -167,7 +160,7 @@ class SimpleLdapUserManager {
       return $this->cache[$cid];
     }
 
-    $query = $this->query->get('user', 'OR')
+    $query = $this->entity_manager->getStorage('user', 'OR')->getQuery()
       ->condition('name', $attribute_values[$name_attribute][0])
       ->condition('mail', $attribute_values[$mail_attribute][0]);
 
diff --git a/simple_ldap.info.yml b/simple_ldap.info.yml
index dbb95be..53546cd 100644
--- a/simple_ldap.info.yml
+++ b/simple_ldap.info.yml
@@ -1,6 +1,7 @@
 name: Simple LDAP
 description: Simple LDAP server configuration.
 type: module
+core_version_requirement: ^8 || ^9
 configure: simple_ldap.server
 core: 8.x
-package: LDAP
\ No newline at end of file
+package: LDAP
diff --git a/src/SimpleLdapServerSchema.php b/src/SimpleLdapServerSchema.php
index 20421de..fd2cb39 100644
--- a/src/SimpleLdapServerSchema.php
+++ b/src/SimpleLdapServerSchema.php
@@ -78,12 +78,12 @@ class SimpleLdapServerSchema {
    */
   public function getSchemaItem($attribute, $name = NULL) {
     if ($this->schemaItemExists($attribute, $name)) {
-      $attribute = Unicode::strtolower($attribute);
+      $attribute = mb_strtolower($attribute);
       if ($name === NULL) {
         return $this->schema[$attribute];
       }
       else {
-        $name = Unicode::strtolower($name);
+        $name = mb_strtolower($name);
         if (isset($this->schema[$attribute][$name])) {
           // Return a named attribute.
           return $this->schema[$attribute][$name];
@@ -92,7 +92,7 @@ class SimpleLdapServerSchema {
           // Search for an alias or OID.
           foreach ($this->schema[$attribute] as $attr) {
             foreach ($attr['aliases'] as $alias) {
-              if (Unicode::strtolower($alias) == Unicode::strtolower($name)) {
+              if (mb_strtolower($alias) == mb_strtolower($name)) {
                 return $attr;
               }
             }
@@ -130,7 +130,7 @@ class SimpleLdapServerSchema {
     // Determine which attributes need to be loaded.
     $load = array();
     foreach ($attributes as $attribute) {
-      $attribute = Unicode::strtolower($attribute);
+      $attribute = mb_strtolower($attribute);
       if (!isset($this->schema[$attribute])) {
         $load[] = $attribute;
       }
@@ -141,14 +141,14 @@ class SimpleLdapServerSchema {
 
       // Parse the schema.
       foreach ($load as $attribute) {
-        $attribute = Unicode::strtolower($attribute);
+        $attribute = mb_strtolower($attribute);
         $this->schema[$attribute] = array();
 
         // Get the values for each attribute.
         if (isset($result[$this->dn][$attribute])) {
           foreach ($result[$this->dn][$attribute] as $value) {
             $parsed = $this->parseSchemaValue($value);
-            $this->schema[$attribute][Unicode::strtolower($parsed['name'])] = $parsed;
+            $this->schema[$attribute][mb_strtolower($parsed['name'])] = $parsed;
           }
         }
       }
@@ -211,7 +211,7 @@ class SimpleLdapServerSchema {
 
     // Loop through the tokens until there are none left.
     while (count($tokens) > 0) {
-      $token = Unicode::strtolower(array_shift($tokens));
+      $token = mb_strtolower(array_shift($tokens));
       if (in_array($token, $novalue)) {
         // Single value token.
         $schema_entry[$token] = 1;
@@ -320,13 +320,13 @@ class SimpleLdapServerSchema {
     $this->loadSchema(array($attribute));
 
     // Check to see if the requested schema entry exists.
-    $attribute = Unicode::strtolower($attribute);
+    $attribute = mb_strtolower($attribute);
     if (isset($this->schema[$attribute])) {
       if ($name === NULL) {
         return (count($this->schema[$attribute]) > 0);
       }
       else {
-        if (isset($this->schema[$attribute][Unicode::strtolower($name)])) {
+        if (isset($this->schema[$attribute][mb_strtolower($name)])) {
           // An attribute of the given name exists.
           return TRUE;
         }
@@ -334,7 +334,7 @@ class SimpleLdapServerSchema {
           // Search for an alias or OID.
           foreach ($this->schema[$attribute] as $attr) {
             foreach ($attr['aliases'] as $alias) {
-              if (Unicode::strtolower($alias) == Unicode::strtolower($name)) {
+              if (mb_strtolower($alias) == mb_strtolower($name)) {
                 return TRUE;
               }
             }
