Skip to content

Commit

Permalink
auth check on slave
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Nov 23, 2023
1 parent 6ab5fcc commit 06a5b02
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/Controller/SlaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,18 @@ public function createAppToken($jwt) {

try {
list($uid, $password, $options) = $this->decodeJwt($jwt);

$saml = false;
if (is_array($options) && isset($options['backend']) && $options['backend'] === 'saml') {
$saml = true;
$this->autoprovisionIfNeeded($uid, $options);
}

if ($this->userManager->userExists($uid)) {
// if we have a password, we verify it
if (!empty($password)) {
$result = $this->userSession->login($uid, $password);
// if we have a password, we verify it; if not it means we should be using saml.
if ($password === '') {
$result = $saml;
} else {
$result = true;
$result = $this->userSession->login($uid, $password);
}
if ($result) {
$token = $this->tokenHandler->generateAppToken($uid);
Expand Down

0 comments on commit 06a5b02

Please sign in to comment.