Skip to content

Commit ef1298a

Browse files
committed
Talk federation authentication
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent cad745b commit ef1298a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/base.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,8 @@ public static function handleRequest(): void {
10541054
// Don't try to login when a client is trying to get a OAuth token.
10551055
// OAuth needs to support basic auth too, so the login is not valid
10561056
// inside Nextcloud and the Login exception would ruin it.
1057-
if ($request->getRawPathInfo() !== '/apps/oauth2/api/v1/token') {
1057+
if ($request->getRawPathInfo() !== '/apps/oauth2/api/v1/token'
1058+
&& !$request->getHeader('X-Nextcloud-Federation')) {
10581059
self::handleLogin($request);
10591060
}
10601061
}

ocs/v1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
// side effects in existing apps
5858
OC_App::loadApps();
5959

60-
if (!\OC::$server->getUserSession()->isLoggedIn()) {
60+
if (!\OC::$server->getUserSession()->isLoggedIn() && !\OC::$server->getRequest()->getHeader('X-Nextcloud-Federation')) {
6161
OC::handleLogin(\OC::$server->getRequest());
6262
}
6363

0 commit comments

Comments
 (0)