diff --git a/composer.lock b/composer.lock
index b07e18744c2d1c39258482409d83083f8ec31be8..9868e21548baf4ffd0c523d07710d0d4b25fd562 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1412,16 +1412,16 @@
         },
         {
             "name": "simplesamlphp/saml2",
-            "version": "v4.6.2",
+            "version": "v4.6.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/simplesamlphp/saml2.git",
-                "reference": "22e06ef0081de210e2a7b45b563fd3cccb9feee6"
+                "reference": "bfc9c79dd6b728a41d1de988f545f6e64728a51d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/22e06ef0081de210e2a7b45b563fd3cccb9feee6",
-                "reference": "22e06ef0081de210e2a7b45b563fd3cccb9feee6",
+                "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/bfc9c79dd6b728a41d1de988f545f6e64728a51d",
+                "reference": "bfc9c79dd6b728a41d1de988f545f6e64728a51d",
                 "shasum": ""
             },
             "require": {
@@ -1464,9 +1464,9 @@
             "description": "SAML2 PHP library from SimpleSAMLphp",
             "support": {
                 "issues": "https://github.com/simplesamlphp/saml2/issues",
-                "source": "https://github.com/simplesamlphp/saml2/tree/v4.6.2"
+                "source": "https://github.com/simplesamlphp/saml2/tree/v4.6.3"
             },
-            "time": "2022-06-11T19:47:27+00:00"
+            "time": "2022-06-13T14:04:10+00:00"
         },
         {
             "name": "symfony/cache",
diff --git a/modules/admin/src/Controller/Federation.php b/modules/admin/src/Controller/Federation.php
index ce3b27314bbb84c0af4927e327ebdee416b206b9..43cbb00fa2b50f37ce0c44c40c57446b786d3d5c 100644
--- a/modules/admin/src/Controller/Federation.php
+++ b/modules/admin/src/Controller/Federation.php
@@ -217,8 +217,8 @@ class Federation
                     Assert::validURI($entity['entityid']);
                     Assert::maxLength(
                         $entity['entityid'],
-                        C::ENTITYID_MAX_LENGTH,
-                        'The entityID cannot be longer than 1024 characters.'
+                        C::SAML2INT_ENTITYID_MAX_LENGTH,
+                        sprintf('The entityID cannot be longer than %d characters.', C::SAML2INT_ENTITYID_MAX_LENGTH)
                     );
 
                     $builder = new SAMLBuilder($entity['entityid']);
@@ -263,8 +263,8 @@ class Federation
                     Assert::validURI($entity['entityid']);
                     Assert::maxLength(
                         $entity['entityid'],
-                        C::ENTITYID_MAX_LENGTH,
-                        'The entityID cannot be longer than 1024 characters.'
+                        C::SAML2INT_ENTITYID_MAX_LENGTH,
+                        sprintf('The entityID cannot be longer than %d characters.', C::SAML2INT_ENTITYID_MAX_LENGTH)
                     );
 
                     $builder = new SAMLBuilder($entity['entityid']);
diff --git a/modules/saml/src/Auth/Source/SP.php b/modules/saml/src/Auth/Source/SP.php
index 4b22aba53739e0aac8c6c69ef57679b8f44d10cd..9e0f5882d7ca901f77b289e412eec5c6a5b91ab5 100644
--- a/modules/saml/src/Auth/Source/SP.php
+++ b/modules/saml/src/Auth/Source/SP.php
@@ -90,8 +90,8 @@ class SP extends \SimpleSAML\Auth\Source
         Assert::validURI($entityId);
         Assert::maxLength(
             $entityId,
-            Constants::ENTITYID_MAX_LENGTH,
-            'The entityID cannot be longer than 1024 characters.'
+            Constants::SAML2INT_ENTITYID_MAX_LENGTH,
+            sprintf('The entityID cannot be longer than %d characters.', Constants::SAML2INT_ENTITYID_MAX_LENGTH)
         );
 
         $this->entityId = $entityId;