Skip to content

Commit 7de995c

Browse files
committed
add support for legacy ID token
1 parent 37fc822 commit 7de995c

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

solid/lib/Controller/StorageController.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace OCA\Solid\Controller;
33

44
use OCA\Solid\DpopFactoryTrait;
5+
use OCA\Solid\BearerFactoryTrait;
56
use OCA\Solid\PlainResponse;
67
use OCA\Solid\Notifications\SolidNotifications;
78

@@ -304,13 +305,28 @@ public function handleRequest($userId, $path) {
304305

305306
$dpop = $this->getDpop();
306307

308+
$error = false;
307309
try {
308310
$webId = $dpop->getWebId($request);
309311
} catch(\Pdsinterop\Solid\Auth\Exception\Exception $e) {
312+
$error = $e;
313+
}
314+
315+
if (!isset($webId)) {
316+
$bearer = $this->getBearer();
317+
try {
318+
$webId = $bearer->getWebId($request);
319+
} catch(\Pdsinterop\Solid\Auth\Exception\Exception $e) {
320+
$error = $e;
321+
}
322+
}
323+
324+
if (!isset($webId)) {
310325
$response = $this->resourceServer->getResponse()
311-
->withStatus(Http::STATUS_CONFLICT, "Invalid token " . $e->getMessage());
326+
->withStatus(Http::STATUS_CONFLICT, "Invalid token");
312327
return $this->respond($response);
313328
}
329+
314330
$origin = $request->getHeaderLine("Origin");
315331
$allowedClients = $this->config->getAllowedClients($userId);
316332
$allowedOrigins = array();

0 commit comments

Comments
 (0)