|
1 | 1 | <?php |
| 2 | + /* |
| 3 | + IMPORTANT WARNING! |
| 4 | +
|
| 5 | + This class is a user backend that accepts 'all'. |
| 6 | + Any user, and password is currently accepted as true. |
| 7 | + |
| 8 | + The reason this is here is that Solid clients will use basic |
| 9 | + authentication to do a POST request to the token endpoint, |
| 10 | + where the actual authorization happens. |
| 11 | +
|
| 12 | + The security for this user backend lies in the fact that it |
| 13 | + is only activated for the token endpoint in the Solid app. |
| 14 | + |
| 15 | + It is completely unsuitable as an actual user backend in the |
| 16 | + normal sense of the word. |
| 17 | + |
| 18 | + It is here to allow the token requests with basic |
| 19 | + authentication requests to pass to us. |
| 20 | + */ |
| 21 | + |
2 | 22 | namespace OCA\Solid; |
3 | 23 |
|
4 | 24 | use OCP\User\Backend\ABackend; |
|
9 | 29 | */ |
10 | 30 | class ClientAuth extends ABackend implements ICheckPasswordBackend { |
11 | 31 | public function __construct() { |
12 | | - error_log("SO Constructed solid client auth backend"); |
13 | 32 | } |
14 | 33 |
|
15 | 34 | public function checkPassword(string $username, string $password) { |
16 | | - error_log("SO checking password for $username"); |
17 | 35 | return true; |
18 | 36 | } |
19 | 37 |
|
20 | 38 | public function getBackendName() { |
21 | | - error_log("SO getBackendName"); |
22 | 39 | return "Solid"; |
23 | 40 | } |
24 | 41 | public function deleteUser($uid) { |
25 | | - error_log("SO deleteUser"); |
26 | 42 | return false; |
27 | 43 | } |
28 | 44 | public function getUsers($search = "", $limit = null, $offset = null, $callback = null) { |
29 | | - error_log("SO getUsers"); |
30 | 45 | return []; |
31 | 46 | } |
32 | 47 | public function userExists($uid) { |
33 | | - error_log("SO User exists"); |
34 | 48 | return true; |
35 | 49 | } |
36 | 50 | public function getDisplayName($uid) { |
37 | | - error_log("SO getDisplayName"); |
38 | 51 | return "Solid client"; |
39 | 52 | } |
40 | 53 | public function getDisplayNames($search = "", $limit = null, $offset = null) { |
41 | | - error_log("SO getDisplayNames"); |
42 | 54 | return []; |
43 | 55 | } |
44 | 56 | public function hasUserListings() { |
45 | | - error_log("SO hasUserListings"); |
46 | 57 | return false; |
47 | 58 | } |
48 | 59 | } |
0 commit comments