server icon indicating copy to clipboard operation
server copied to clipboard

App Login credentials not working

Open ka223 opened this issue 6 years ago • 48 comments

I am using nextcloud 18.0.6 and recently upgraded from 18.0.3.

The additional app passwords from security -> devices & sessions are not working. Passwords are generated over the "Create new app password" button.

I created a new app password, the android nextcloud app responds with incorrect credentials, same by using a browser and the app login.

The log says:

Info core Bruteforce attempt from “****” detected for action “login”.
Warning no app in context Login failed: **** (Remote IP: ****)

I cleared the database bruteforce attempt entry with my IP address, but at the first login attempt with the correct (generated) app login credentials, a new bruteforce attempt entry is created in the database and the login is rejected with "Wrong username or password. "

Update: Just tested on a nextcloud hoster with 18.0.6 (updated from 18.0.3), with the same problem!

Steps to reproduce

  1. maybe upgrade from18.0.3. to 18.0.6
  2. "Create new app password"
  3. Login with the generated password inside browser or android nextcloud app

Expected behaviour

Login successful.

Actual behaviour

Error Message "Wrong username or password. "

Server configuration

Debian buster

Web server: Apache 2.4.38-3+deb10u3

Database: MariaDB

PHP version: php 7.3

**Nextcloud version: 18.0.6

Updated from an older Nextcloud/ownCloud or fresh install: 18.0.3.

Where did you install Nextcloud from: https://nextcloud.com/install/ Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Enabled:
  - accessibility: 1.4.0
  - activity: 2.11.0
  - admin_audit: 1.8.0
  - calendar: 2.0.3
  - cloud_federation_api: 1.1.0
  - comments: 1.8.0
  - contacts: 3.3.0
  - dav: 1.14.0
  - federatedfilesharing: 1.8.0
  - files: 1.13.1
  - files_pdfviewer: 1.7.0
  - files_rightclick: 0.15.2
  - files_trashbin: 1.8.0
  - files_versions: 1.11.0
  - files_videoplayer: 1.7.0
  - firstrunwizard: 2.7.0
  - logreader: 2.3.0
  - lookup_server_connector: 1.6.0
  - nextcloud_announcements: 1.7.0
  - notes: 3.6.0
  - notifications: 2.6.0
  - oauth2: 1.6.0
  - password_policy: 1.8.0
  - photos: 1.0.0
  - privacy: 1.2.0
  - provisioning_api: 1.8.0
  - recommendations: 0.6.0
  - serverinfo: 1.8.0
  - settings: 1.0.0
  - sharebymail: 1.8.0
  - support: 1.1.1
  - survey_client: 1.6.0
  - systemtags: 1.8.0
  - text: 2.0.0
  - theming: 1.9.0
  - twofactor_backupcodes: 1.7.0
  - updatenotification: 1.8.0
  - viewer: 1.2.0
  - workflowengine: 2.0.0
Disabled:
  - encryption
  - federation
  - files_external
  - files_sharing
  - user_ldap

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

{ "system": { "instanceid": "REMOVED SENSITIVE VALUE", "passwordsalt": "REMOVED SENSITIVE VALUE", "secret": "REMOVED SENSITIVE VALUE", "trusted_domains": [ "192.168..", ".de" ], "datadirectory": "REMOVED SENSITIVE VALUE", "overwrite.cli.url": "https://192.168..*/nextcloud", "dbtype": "mysql", "version": "18.0.6.0", "dbname": "REMOVED SENSITIVE VALUE", "dbhost": "REMOVED SENSITIVE VALUE", "dbtableprefix": "oc_", "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "forcessl": true, "forceSSLforSubdomains": true, "loglevel": 0, "theme": "", "memcache.local": "\OC\Memcache\APCu", "maintenance": false, "updatechecker": false, "appstoreenabled": true, "trashbin_retention_obligation": "auto", "htaccess.RewriteBase": "/nextcloud", "mysql.utf8mb4": true, "updater.secret": "REMOVED SENSITIVE VALUE" } }

ka223 avatar Jul 14 '20 22:07 ka223

Same problem on 19.0.1, newly generated app passwords are no longer working.

MaxXor avatar Aug 02 '20 08:08 MaxXor

Same problem on 18.0.7, debian buster with Apache 2.4 and PHP 7.3

Palulukas avatar Aug 11 '20 12:08 Palulukas

I see the same thing here, errors in the log that I think are related look like this:

[no app in context] Warning: Login failed: nielsenb (Remote IP: 172.19.0.2)

POST /login
from 172.19.0.2 at 2020-08-18T21:23:35+00:00

I am running Nextcloud behind a reverse proxy with nginx to handle SSL. I managed to get things working by setting 'overwriteprotocol' => 'https' in config.php.

nielsenb-jf avatar Aug 19 '20 12:08 nielsenb-jf

I see the same thing here, errors in the log that I think are related look like this:

[no app in context] Warning: Login failed: nielsenb (Remote IP: 172.19.0.2)

POST /login
from 172.19.0.2 at 2020-08-18T21:23:35+00:00

I am running Nextcloud behind a reverse proxy with nginx to handle SSL. I managed to get things working by setting 'overwriteprotocol' => 'https' in config.php.

Thanks for your effort, I'll try your fix very soon!

Palulukas avatar Aug 19 '20 13:08 Palulukas

I see the same thing here, errors in the log that I think are related look like this:

[no app in context] Warning: Login failed: nielsenb (Remote IP: 172.19.0.2)

POST /login
from 172.19.0.2 at 2020-08-18T21:23:35+00:00

I am running Nextcloud behind a reverse proxy with nginx to handle SSL. I managed to get things working by setting 'overwriteprotocol' => 'https' in config.php.

Still login failed "Wrong username or password. " with app login. :/

ka223 avatar Aug 19 '20 16:08 ka223

@nielsenb-jf Sadly the workaround is not working here.

This should be higher priority as it's currently no longer possible to add new apps to the nextcloud account without revealing the main password.

MaxXor avatar Aug 23 '20 17:08 MaxXor

I see the same thing here, errors in the log that I think are related look like this:

[no app in context] Warning: Login failed: nielsenb (Remote IP: 172.19.0.2)

POST /login
from 172.19.0.2 at 2020-08-18T21:23:35+00:00

I am running Nextcloud behind a reverse proxy with nginx to handle SSL. I managed to get things working by setting 'overwriteprotocol' => 'https' in config.php.

Still login failed "Wrong username or password. " with app login. :/

Same here. :/

Palulukas avatar Aug 25 '20 07:08 Palulukas

Also fails for me, Nextcloud 19.0.2

https://<myDomain>.com/index.php/settings/integrity/failed returns

No errors have been found.

PhilLab avatar Aug 27 '20 17:08 PhilLab

Issue persists on Nextcloud 19.0.5.

MaxXor avatar Nov 20 '20 15:11 MaxXor

... issue persists on Nextcloud 20.0.7.1

How is this possible?

ka223 avatar Feb 28 '21 15:02 ka223

'overwriteprotocol' => 'https' doesn't work for me either, since it was already configured like that. Tested with our own server as well as public hoster; generating a new app-password and using it afterwards newer works. This is now actually a problem for our intended backup strategy, since all accounts require 2FA and this is hardly possible with nextcloud in a headless linux. It's concerning at least, to see that this kind of issue hasn't even been adressed yet.

Prometheus9001 avatar Mar 15 '21 10:03 Prometheus9001

I've had the same kind of issue after moving my native Nexcloud instance into Docker with the apache image (version 21.0.0.18). Using nginx in front to enable HTTPS was working fine for accessing though a browser but all my desktop and mobile clients were failing with the authentication, which of course triggered the bruteforce protection and made me crazy before I ended here. The addind of 'overwriteprotocol' => 'https' in the config.php solved the issue for me, also I have aligned the 'overwrite.cli.url' parameter with the vhost name of my https proxy (not sure it was needed).

cdeletre avatar Mar 22 '21 10:03 cdeletre

I have the same issue. Adding 'overwriteprotocol' => 'https' does nothing. I have nextcloud snap installation in VM under proxy. System couldn't recognize generated app passwords. Creating new users are going well.


Addition after further investigation and tests.

  1. Generated passwords work for android and ios syncing app. Was using it via QR code.
  2. Generated passwords dont work for desktop syncing app. It opens browser windows where login with newly generated password fails.

Anisotropic avatar May 18 '21 21:05 Anisotropic

The same issue: NC 20.0.9.

Authenticating an android NC client via QR of app password works. Granting access from android NC client to DAVx works.

However, manually copy & paste app password to DAVx or KeePass2Android fails with response "protocol=http/1.1, code=401,message=Unauthorized".

Old app passwords created in the past continue to work.

EDIT: using LDAP backend. NC username is name_surname, while LDAP allows for Name Surname, name_s or email.

archont00 avatar Jun 04 '21 20:06 archont00

Thank you for taking the time to report a bug! 👍

As this seems to be a setup issue I would like to ask you to raise your question in the forums: https://help.nextcloud.com If you wish support with setup issues from Nextcloud GmbH we offer this as part of the Nextcloud subscription. Learn more about this at https://nextcloud.com/enterprise/

szaimen avatar Jul 07 '21 12:07 szaimen

@szaimen I fear this is not a setup issue. The app credentials do not work and above comments are just talking about work around which do not work, as I understood it

PhilLab avatar Jul 07 '21 12:07 PhilLab

Maybe yes but in contrary app credentials work on my instance and other instances so there is probably something wrong with their setup...

szaimen avatar Jul 07 '21 12:07 szaimen

@szaimen

This issue has already been discussed in the forum: https://help.nextcloud.com/t/app-password-not-working/87228

Only manual created app passwords are affected and I can not see a possible config issue. On my own instance and on my hosters instance (not administered by me) is this issue. A lot of other people here could reproduce this problem. Maybe not anyone notice this problem, because it is only at self created app passwords.

If you think some configuration can cause this issue, please give me an config example here or in the nextcloud forum, at could cause this specific failure. I would like to test this.

ka223 avatar Jul 07 '21 14:07 ka223

Same Issue on NC21.0.3 on Ubuntu 18LTS behind a nginx reverse Proxy. My old tokens still work, only newley created fail. Definitely an issue with nextcloud code.

FaySmash avatar Jul 11 '21 18:07 FaySmash

Migration from NC 22.0 to NC 22.1.0: getting worse. NC 22.1.0 docker, behind nginx reverse Proxy

No logging ar all on Android App for all account, old or new created account. QR Code, Token, App Credential, or normal logging same behavior, return to login page without error.

Login perfect on firefox browser.

flammekueche avatar Aug 08 '21 17:08 flammekueche