Skip to content

Commit

Permalink
Merge pull request #138 from nextcloud/fix/noid/auth-saml
Browse files Browse the repository at this point in the history
auth check on slave
  • Loading branch information
ArtificialOwl authored Nov 23, 2023
2 parents 315e544 + c224fd0 commit ab5da57
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/Controller/SlaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,14 @@ public function createAppToken($jwt) {

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

if (is_array($options) && isset($options['backend']) && $options['backend'] === 'saml') {
$saml = (($options['backend'] ?? '') === 'saml');
if ($saml) {
$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);
} else {
$result = true;
}
// if we have a password, we verify it; if not it means we should be using saml.
$result = ('' === $password) ? $saml : $this->userSession->login($uid, $password);
if ($result) {
$token = $this->tokenHandler->generateAppToken($uid);

Expand Down

0 comments on commit ab5da57

Please sign in to comment.