diff --git a/src/User/AuthClient/Keycloak.php b/src/User/AuthClient/Keycloak.php new file mode 100644 index 0000000..42a3cd7 --- /dev/null +++ b/src/User/AuthClient/Keycloak.php @@ -0,0 +1,35 @@ +getUserAttributes()['email'] ?? null; + } + + /** + * {@inheritdoc} + */ + public function getUserName() + { + // claim from profile scope + return $this->getUserAttributes()['preferred_username'] ?? $this->getEmail(); + } + + /** + * {@inheritdoc} + */ + public function getUserId() + { + return $this->getUserAttributes()['sub'] ?? null; + } +}