From 7009a3bebc164742df92e428795aa606b0f5efbe Mon Sep 17 00:00:00 2001 From: giorgioma Date: Tue, 1 Dec 2020 02:46:00 +0100 Subject: [PATCH] Fix errors without a description --- src/Provider/Keycloak.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Provider/Keycloak.php b/src/Provider/Keycloak.php index 04dcf6f..d9d6a0c 100644 --- a/src/Provider/Keycloak.php +++ b/src/Provider/Keycloak.php @@ -201,7 +201,10 @@ protected function getScopeSeparator() protected function checkResponse(ResponseInterface $response, $data) { if (!empty($data['error'])) { - $error = $data['error'].': '.$data['error_description']; + $error = $data['error']; + if(isset($data['error_description'])){ + $error.=': '.$data['error_description']; + } throw new IdentityProviderException($error, 0, $data); } }