add a meaningful error message in case a empty uid is given

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Björn Schiessle 2018-01-16 12:14:21 +01:00
parent 25a2b0829c
commit b9d5f56d25
No known key found for this signature in database
GPG key ID: 2378A753E2BF04F6

View file

@ -99,6 +99,12 @@ class SAMLController extends Controller {
$uid = $auth[$uidMapping];
}
// make sure that a valid UID is given
if (empty($uid)) {
$this->logger->error('Uid "' . $uid . '" is not a valid uid please check your attribute mapping', ['app' => $this->appName]);
throw new \InvalidArgumentException('No valid uid given, please check your attribute mapping. Given uid: ' . $uid);
}
$userExists = $this->userManager->userExists($uid);
$autoProvisioningAllowed = $this->userBackend->autoprovisionAllowed();
if($userExists === true) {