Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If basic auth provided but invalid fail #23914

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ public static function handleRequest() {
*
* @param OCP\IRequest $request
* @return boolean
* @throws \OC\User\LoginException
*/
public static function handleLogin(OCP\IRequest $request) {
$userSession = self::$server->getUserSession();
Expand Down
4 changes: 3 additions & 1 deletion lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ protected function prepareUserLogin($firstTimeLogin, $refreshCsrfToken = true) {
* @param IRequest $request
* @param OC\Security\Bruteforce\Throttler $throttler
* @return boolean if the login was successful
* @throws LoginException
*/
public function tryBasicAuthLogin(IRequest $request,
OC\Security\Bruteforce\Throttler $throttler) {
Expand All @@ -599,8 +600,9 @@ public function tryBasicAuthLogin(IRequest $request,

return true;
}
throw new LoginException('Basic auth failed while credentials provided');
} catch (PasswordLoginForbiddenException $ex) {
// Nothing to do
throw new LoginException('Password login not allowed', 0, $ex);
}
}
return false;
Expand Down