Skip to content

Commit

Permalink
fix(Token): add FILESYSTEM scope with SCOPE_SKIP_PASSWORD_VALIDATION
Browse files Browse the repository at this point in the history
The scope design requires scopes to be either not specified, or
specified explicitely. Therefore, when setting the
skip-password-validation scope for user authentication from mechanisms
like SAML, we also have to set the filesystem scope, otherwise they will
lack access to the filesystem.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz authored and backportbot[bot] committed Jun 25, 2024
1 parent 1da03bb commit 5b7c4cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/private/legacy/OC_User.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ public static function loginWithApache(\OCP\Authentication\IApacheBackend $backe
if (empty($password)) {
$tokenProvider = \OC::$server->get(IProvider::class);
$token = $tokenProvider->getToken($userSession->getSession()->getId());
$token->setScope(['password-unconfirmable' => true]);
$token->setScope([
'password-unconfirmable' => true,
'filesystem' => true,
]);
$tokenProvider->updateToken($token);
}

Expand Down

0 comments on commit 5b7c4cc

Please sign in to comment.