Creating app password doesn't work

All right, so client side it looks okay then. The check on the server (for that error message that you’re seeing) is quite simple:

So it looks like the header never reaches the server (or at least not the php code).
Which webserver are you all using and which kind of php (mod_php or php-fpm)?

Apache2, php-fpm

Let’s check a few things:

  • Loaded modules with apachectl -M
  • Virtual host config of apache
  • Basic auth in general curl -H "OCS-APIRequest: true" -u admin:admin https://nextcloud-mm.local/ocs/v2.php/cloud/user/fields (adjust user, password and url obviously)
  • Check /index.php/settings/admin, anything noted there as error or warning?

Basic aut:

Modules:

No errors in protocoll related to the actual problem.

Sorry I am unable to wrap my head around this, something must be missing…
But what I noticed, you said you’re using php-fpm, but as module mod_php is loaded?!

Can you also post the apache/virtual host config?

I have the same issue using IONOS shared webspace. This behavior started on the latest version of 33. Because of this I upgraded to version 34.0.1 but with no improvement.

And I see the same behaviour on my RasPi test drive installation. There are no issues with this using webspace of other hosters like All-Inkl, Lima City etc. So, it may be related to IONOS. However, there must also be a change in Nextcloud that triggers this behavior, because password generation works in earlier versions of 33.

I suppose that’s also why there’s a problem with apps not being able to be updated via the web interface.

Is that something that can be reproduced from the installation? Can you drop me how you installed it?

Just standard installation of apache from RasPI OS. Uploaded php files, setup MariaDB, only http, that’s it. I haven’t looked into it any further yet. I just happened to notice it this morning.

Following a tip from Google, I tested the authorization header redirection in the Nextcloud directory.
Test file test.php:

<?php
header('Content-Type: text/plain');
print_r(getallheaders());
print_r(apache_response_headers());
?>


grafik

Result:

So it seems that the forwarding of the Authorization header is working.

I am not yet sure why it is not working on IONOS webspace, but found 2 things while checking with @SkyBlueHH (thanks for the help!):

  • Missing mod_rewrite (make sure it is enabled a2enmod rewrite and rewrite)
  • Ensure .htaccess processing is actually allowed (check for AllowOverride)

As the person who started this thread, I suspect that a required module is unavailable on the IONOS web space.
Since I need a working system soon, I am opting to migrate to a vServer where I have full control over Apache.

Quick update:
On my RasPi, the .htaccess files were indeed being ignored by the default settings. However, without the .htaccess files, there’s a problem transferring authorisation to Nextcloud. Fixed, config problem. :see_no_evil_monkey:

In my view, mod_rewrite has nothing to do with the authorisation issue. Nevertheless, it should, of course, be there and work properly.

At the moment, I’m checking whether there’s a problem with unavailable Apache modules. I’ve found a list from IONOS to figure this out. I suspect that a module is unavailable. An initial test seems to confirm this. Stay tuned.

It depends, it is not strictly neccessary (there are other modules doing a similar thing when you check the .htaccess), but it also sets the Auth headers (again, check .htaccess).

With the help of @SkyBlueHH we tested fix: Use PHP_AUTH_PW for strict password confirmation by SystemKeeper · Pull Request #62477 · nextcloud/server · GitHub and it seems to work.

It is not reviewed yet, but if someone wants to give it a try and report back, the 34/33 version can be found at https://github.com/nextcloud/server/commit/c66f5f230af5817789fecc743b737731600cc3e5.patch.

I’ve tried the Patch for 34/33 and it seems to work fine. I could create app passwords with TOTP enabled now.

I am on Hetzner managed service (v33.0.8) and same problem here.
Before it was working, but now the dialog with the new app password is not coming in.
occ is not an option here, because only I have occ access, my users don’t.