mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-05 18:43:40 +02:00
log provisioning errors during sso environment login
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
bf4de7be29
commit
f20252a5f4
|
@ -146,7 +146,7 @@ class SAMLController extends Controller {
|
||||||
if($this->userManager->userExists($uid)) {
|
if($this->userManager->userExists($uid)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw new NoUserFoundException();
|
throw new NoUserFoundException('Auto provisioning not allowed and user ' . $uid . ' does not exist');
|
||||||
} elseif(!$userExists && $autoProvisioningAllowed) {
|
} elseif(!$userExists && $autoProvisioningAllowed) {
|
||||||
$this->userBackend->createUserIfNotExists($uid);
|
$this->userBackend->createUserIfNotExists($uid);
|
||||||
$this->userBackend->updateAttributes($uid, $auth);
|
$this->userBackend->updateAttributes($uid, $auth);
|
||||||
|
@ -154,7 +154,7 @@ class SAMLController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NoUserFoundException();
|
throw new NoUserFoundException('Remote user environment variable (' . $uidMapping . ') not found in environment');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -186,10 +186,13 @@ class SAMLController extends Controller {
|
||||||
$this->autoprovisionIfPossible($this->session->get('user_saml.samlUserData'));
|
$this->autoprovisionIfPossible($this->session->get('user_saml.samlUserData'));
|
||||||
$user = $this->userManager->get($this->userBackend->getCurrentUserId());
|
$user = $this->userManager->get($this->userBackend->getCurrentUserId());
|
||||||
if(!($user instanceof IUser)) {
|
if(!($user instanceof IUser)) {
|
||||||
throw new NoUserFoundException();
|
throw new NoUserFoundException('User' . $this->userBackend->getCurrentUserId() . ' not valid or not found');
|
||||||
}
|
}
|
||||||
$user->updateLastLoginTimestamp();
|
$user->updateLastLoginTimestamp();
|
||||||
} catch (NoUserFoundException $e) {
|
} catch (NoUserFoundException $e) {
|
||||||
|
if ($e->getMessage()) {
|
||||||
|
$this->logger->warning('Error while trying to login using sso environment variable: ' . $e->getMessage(), ['app' => 'user_saml']);
|
||||||
|
}
|
||||||
$ssoUrl = $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.notProvisioned');
|
$ssoUrl = $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.notProvisioned');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue