From 2083c1e13abd67d8b8536fc7fe8bd370b266c114 Mon Sep 17 00:00:00 2001 From: Lucas D Hedding Date: Tue, 14 Dec 2021 10:06:23 -0600 Subject: [PATCH] enhance the resource owner object --- src/Provider/KeycloakResourceOwner.php | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/Provider/KeycloakResourceOwner.php b/src/Provider/KeycloakResourceOwner.php index b1cca71..1b13130 100644 --- a/src/Provider/KeycloakResourceOwner.php +++ b/src/Provider/KeycloakResourceOwner.php @@ -53,6 +53,56 @@ public function getName() return $this->response['name'] ?: null; } + /** + * Get resource owner email verification + * + * @return bool + */ + public function getEmailVerified() + { + return $this->response['email_verified'] ?? false; + } + + /** + * Get resource owner family name + * + * @return string|null + */ + public function getFamilyName() + { + return $this->response['family_name'] ?: null; + } + + /** + * Get resource owner given name + * + * @return string|null + */ + public function getGivenName() + { + return $this->response['given_name'] ?: null; + } + + /** + * Get resource owner preferred username + * + * @return string|null + */ + public function getPreferredUsername() + { + return $this->response['preferred_username'] ?? null; + } + + /** + * Get resource owner picture + * + * @return string|null + */ + public function getPicture() + { + return $this->response['picture'] ?? null; + } + /** * Return all of the owner details available as an array. *