0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-18 04:01:41 +00:00
nextcloud_server/apps/federation/lib/DAV/FedAuth.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2015-12-03 16:22:18 +01:00
<?php
2015-12-03 16:22:18 +01:00
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
2015-12-03 16:22:18 +01:00
*/
namespace OCA\Federation\DAV;
2015-12-03 16:22:18 +01:00
use OCA\Federation\DbHandler;
use OCP\Defaults;
2015-12-03 16:22:18 +01:00
use Sabre\DAV\Auth\Backend\AbstractBasic;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
2015-12-03 16:22:18 +01:00
class FedAuth extends AbstractBasic {
/**
* FedAuth constructor.
*
2015-12-07 15:28:06 +01:00
* @param DbHandler $db
2015-12-03 16:22:18 +01:00
*/
public function __construct(
private DbHandler $db,
) {
2015-12-03 16:22:18 +01:00
$this->principalPrefix = 'principals/system/';
// setup realm
$defaults = new Defaults();
$this->realm = $defaults->getName();
2015-12-03 16:22:18 +01:00
}
/**
* Validates a username and password
*
* This method should return true or false depending on if login
* succeeded.
*
* @param string $username
* @param string $password
* @return bool
*/
protected function validateUserPass($username, $password) {
2015-12-07 15:28:06 +01:00
return $this->db->auth($username, $password);
2015-12-03 16:22:18 +01:00
}
/**
* @inheritdoc
*/
public function challenge(RequestInterface $request, ResponseInterface $response) {
}
2015-12-03 16:22:18 +01:00
}