Skip to content

Commit

Permalink
If basic auth provided but invalid fail
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Nov 5, 2020
1 parent ecbe8cb commit d0831b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit d0831b9

Please sign in to comment.