Skip to content

Commit

Permalink
Talk federation authentication
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Oct 9, 2023
1 parent cad745b commit ef1298a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,8 @@ public static function handleRequest(): void {
// Don't try to login when a client is trying to get a OAuth token.
// OAuth needs to support basic auth too, so the login is not valid
// inside Nextcloud and the Login exception would ruin it.
if ($request->getRawPathInfo() !== '/apps/oauth2/api/v1/token') {
if ($request->getRawPathInfo() !== '/apps/oauth2/api/v1/token'
&& !$request->getHeader('X-Nextcloud-Federation')) {
self::handleLogin($request);
}
}
Expand Down
2 changes: 1 addition & 1 deletion ocs/v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
// side effects in existing apps
OC_App::loadApps();

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

Expand Down

0 comments on commit ef1298a

Please sign in to comment.