Merge pull request #29320 from nextcloud/bugfix/28261/fix-basic-auth-for-oauth-token-endpoint

Fix basic auth for OAuth token endpoint
This commit is contained in:
Christoph Wurst 2021-10-20 17:31:43 +02:00 committed by GitHub
commit b98f3f31de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -987,7 +987,13 @@ class OC {
} else {
// For guests: Load only filesystem and logging
OC_App::loadApps(['filesystem', 'logging']);
self::handleLogin($request);
// 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') {
self::handleLogin($request);
}
}
}