From a6f1f9ea77643fa5896939ea02b53f33c5c8e344 Mon Sep 17 00:00:00 2001 From: Marko Ivancic Date: Fri, 31 Jan 2025 10:15:34 +0100 Subject: [PATCH] Make name of the identifier attribute set in config visible in the error message --- src/Services/AuthenticationService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Services/AuthenticationService.php b/src/Services/AuthenticationService.php index 5e579117..04dbe5d8 100644 --- a/src/Services/AuthenticationService.php +++ b/src/Services/AuthenticationService.php @@ -105,7 +105,12 @@ public function getAuthenticateUser( if (!array_key_exists($this->userIdAttr, $claims) || !is_array($claims[$this->userIdAttr])) { $attr = implode(', ', array_keys($claims)); throw new Error\Exception( - 'Attribute `useridattr` doesn\'t exists in claims. Available attributes are: ' . $attr, + sprintf( + 'User identifier attribute `%s` does not exist in the user attribute state.' . + ' Available attributes are: %s.', + $this->userIdAttr, + $attr, + ), ); }