diff --git a/templates/selectidp-dropdown.php b/templates/selectidp-dropdown.php
index a3c4d2bf1d014c5720cdd389d689e5eee267c3e5..3f473b7356f1f1e897ed702ea4310525582b28e6 100644
--- a/templates/selectidp-dropdown.php
+++ b/templates/selectidp-dropdown.php
@@ -34,7 +34,7 @@ foreach ($this->data['idplist'] as $idpentry) {
         <select id="dropdownlist" name="idpentityid">
             <?php
             usort($this->data['idplist'], function ($idpentry1, $idpentry2) {
-                return strcmp(
+                return strcasecmp(
                     $this->t('idpname_'.$idpentry1['entityid']),
                     $this->t('idpname_'.$idpentry2['entityid'])
                 );
diff --git a/templates/selectidp-links.php b/templates/selectidp-links.php
index b8f2d6e3d89d6c6dd40244993108b3e1d8bfcded..5a6b0c359ae89160b263bc8c04791cba9ee184fc 100644
--- a/templates/selectidp-links.php
+++ b/templates/selectidp-links.php
@@ -34,6 +34,12 @@ foreach ($this->data['idplist'] as $idpentry) {
             }
             ?></p>
 <?php
+        usort($this->data['idplist'], function ($idpentry1, $idpentry2) {
+            return strcasecmp(
+                $this->t('idpname_'.$idpentry1['entityid']),
+                $this->t('idpname_'.$idpentry2['entityid'])
+            );
+        });
         if (!empty($this->data['preferredidp']) &&
             array_key_exists($this->data['preferredidp'], $this->data['idplist'])
         ) {