Skip to content

Password login forbidden hint - #25162

Merged
PVince81 merged 3 commits into
masterfrom
password-login-forbidden-hint
Jun 20, 2016
Merged

PVince81 merged 3 commits into
masterfrom
password-login-forbidden-hint

Conversation

@ChristophWurst

Copy link
Copy Markdown
Contributor

fixes #25091

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @LukasReschke, @DeepDiver1975 and @icewind1991 to be potential reviewers

@ChristophWurst
ChristophWurst force-pushed the password-login-forbidden-hint branch from b65b035 to 5a8cfab Compare June 17, 2016 09:30
The auth code from Sabre will forward NotAuthenticated exceptions but
in the case of a generic exception, it is packaged as "service not
available".
@PVince81

Copy link
Copy Markdown
Contributor

Fixed exception type.

Works now:

  % curl -D - -X PROPFIND http://admin:admin@localhost/owncloud/remote.php/webdav/
HTTP/1.1 401 Unauthorized
Date: Fri, 17 Jun 2016 13:49:55 GMT
Server: Apache/2.4.20 (Linux/SUSE)
X-Powered-By: PHP/5.6.22
Set-Cookie: ockbfur1449k=k30ahaqbsg8iq5c2p3hdag4m4ig42s21k9pj20k4aqltans1o881; path=/owncloud; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: oc_sessionPassphrase=1QhZfo87rcLL%2FyyWEmw6DHaltw5QavQdw0%2FyimJAHgOorVpD1kYiwb8WqyWqzTbQ07SOHnRxS1T18Yt6C3FMv7pAMo7DfM5SbOX6ZQtLP3PLeu7IRLq1GMtauJX381K6; path=/owncloud; httponly
Content-Security-Policy: default-src 'none';
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: Sameorigin
X-Robots-Tag: none
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Content-Length: 299
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:o="http://owncloud.org/ns">
  <s:exception>OCA\DAV\Connector\Sabre\Exception\PasswordLoginForbidden</s:exception>
  <s:message/>
  <o:hint xmlns:o="o:">password login forbidden</o:hint>
</d:error>

@ogoffart @guruz

@ChristophWurst

Copy link
Copy Markdown
Contributor Author

👍 works

@icewind1991

Copy link
Copy Markdown
Contributor

Looks good 👍

@guruz

guruz commented Jun 17, 2016

Copy link
Copy Markdown
Contributor

Did you check if the client actually displays this?

@PVince81

Copy link
Copy Markdown
Contributor

No, I only checked that the exception was returned. Not sure if the client side is ready ?

@PVince81
PVince81 merged commit 88b9f5a into master Jun 20, 2016
@PVince81
PVince81 deleted the password-login-forbidden-hint branch June 20, 2016 15:05
@PVince81

Copy link
Copy Markdown
Contributor

@ChristophWurst @ogoffart @guruz please check with the client. This is merged, so check out master when testing.

@guruz

guruz commented Jun 21, 2016

Copy link
Copy Markdown
Contributor

Testing client now: I don't seem to get it with the wizard..

06-21 13:17:05:263 176703 OCC::OwncloudSetupWizard::slotConnectToOCUrl: Connect to url:  "http://127.0.0.1:1239/"
06-21 13:17:05:264 176703 OCC::OwncloudWizard::appendToConfigurationLog: Setup-Log:  "Trying to connect to ownCloud at http://127.0.0.1:1239/..."
06-21 13:17:05:264 176703 OCC::AbstractNetworkJob::start: !!! OCC::PropfindJob created for "http://127.0.0.1" + "/" "OCC::OwncloudSetupWizard"
06-21 13:17:05:329 176703 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() QNetworkReply::NetworkError(AuthenticationRequiredError) "Host requires authentication" QVariant(int, 401)
06-21 13:17:05:329 176703 OCC::PropfindJob::finished: PROPFIND request *not* successful, http result code is 401 ""

But I get it if the account was already setup before I get a repeating password input dialog:

06-21 13:20:47:356 179577 OCC::ConnectionValidator::checkAuthentication: # Check whether authenticated propfind works.
06-21 13:20:47:357 179577 OCC::AbstractNetworkJob::start: !!! OCC::PropfindJob created for "http://127.0.0.1" + "/" "OCC::ConnectionValidator"
06-21 13:20:47:444 179577 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() QNetworkReply::NetworkError(AuthenticationRequiredError) "Host requires authentication" QVariant(int, 401)
06-21 13:20:47:444 179577 OCC::AccountSettings::showConnectionLabel: "No connection to ownCloud at <a href=\"http://127.0.0.1:1239\">http://127.0.0.1:1239</a>.\nThe provided credentials are not correct"
06-21 13:20:47:447 179577 OCC::FolderMan::slotAccountStateChanged: Account "[email protected]:1239" disconnected or paused, terminating or descheduling sync folders
06-21 13:20:47:447 179577 OCC::PropfindJob::finished: PROPFIND request *not* successful, http result code is 401 ""
06-21 13:20:47:447 179577 OCC::ConnectionValidator::slotAuthFailed: QNetworkReply::NetworkError(AuthenticationRequiredError) "Host requires authentication"
06-21 13:20:47:447 179577 OCC::ConnectionValidator::slotAuthFailed: ******** Password is wrong!

@guruz

guruz commented Jun 21, 2016

Copy link
Copy Markdown
Contributor

If I change getHTTPCode to return 403 it works better.
It shows "Forbidden (OCA\DAV\Connector\Sabre\Exception\PasswordLoginForbidden" in the desktop client in both wizard and if the account is already setup.

@lock

lock Bot commented Aug 5, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add hint in 401 response when regular password is disabled (2FA)

5 participants