From 0b8ea6d168c2266b422fadcf9930504b1dbac504 Mon Sep 17 00:00:00 2001 From: CSDUMMI Date: Thu, 20 Jul 2023 11:08:35 +0200 Subject: [PATCH] Use the preferred_username claim to get the resource owner name as that is the standard claim defined by the OpenID standard --- src/Provider/KeycloakResourceOwner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Provider/KeycloakResourceOwner.php b/src/Provider/KeycloakResourceOwner.php index 7587af7..22d98af 100644 --- a/src/Provider/KeycloakResourceOwner.php +++ b/src/Provider/KeycloakResourceOwner.php @@ -50,7 +50,7 @@ public function getEmail() */ public function getName() { - return \array_key_exists('name', $this->response) ? $this->response['name'] : null; + return \array_key_exists('preferred_username', $this->response) ? $this->response['preferred_username'] : null; } /**