Desktop Client Login OIDC - no redirect to /.well-known/openid-configuration

I installed owncloud and keycloak in docker. Login via web browser is working fine. But not via Desktop client. I followed this article https://doc.owncloud.com/server/10.11/admin_manual/configuration/user/oidc/oidc.html#set-up-service-discovery

After changing the .htaccess file under /mnt/data/files/.htaccess the desktop client login is not working

If I open https://[urlToMyOwncloud]/.well-known/openid-configuration I’m still being redirected to https://[urlToMyOwncloud]/apps/files

Expected behaviour

After providing the server url and loging in via OIDC I expect not seeing the “Reopen in Browser” dialog.

Actual behaviour

Tell us what happens instead
The login does not progress.

Steps to reproduce

  1. Install keycloak and owncloud in docker with a named volumes persist files
  2. Add the owncloud client with the correct client-id and secrete by importing the example file
  3. Edit the .htaccess file in the owncloud docker container
  4. Try logging in via the desktop client

Server configuration

Operating system:
Docker on Windows 10
Web server:
apache
Database:
mariadb 10.6
PHP version:
PHP 7.4.3-4ubuntu2.19 (cli) (built: Jun 27 2023 15:49:59) ( NTS )
ownCloud version:
10.12.2 (stable)
Storage backend (external storage):

Client configuration

Client version:
ownCloud-4.2.0.11670.x64
Operating system:
Windows 10
OS language:
German
Qt version used by client package (Linux only, see also Settings dialog):

Client package (From ownCloud or distro) (Linux only):

Installation path of client:
C:\Program Files\ownCloud

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer
logs.

Template for output < 10 lines

  1. Client logfile: Output of owncloud --logwindow or owncloud --logfile log.txt
    (On Windows using cmd.exe, you might need to first cd into the ownCloud directory)
    (See also Redirect Notice )

  2. Web server error log:

  3. Server logfile: ownCloud log (data/owncloud.log):

Hey,

from pure guessing i don’t think that this is the correct location of the file. I think the file location should be more something like this for example:

/var/www/html/owncloud/.htaccess

or similar depending where ownCloud has been installed to. I think it is also important that the web server is using .htaccess files in general and that the file system is a linux file system and not a file system of the windows host system.

Hey, thanks for the quick reply.

I added the lines

RewriteEngine on
RewriteRule  ^/.well-known/openid-configuration  /index.php/apps/openidconnect/config  [P]

to the /var/www/html/owncloud/.htaccess file.

I’m not sure why I did not noticed that file before.
But the redirect behavior did not change.

I got it working by adding a custom location in my Nginx Proxy Manager.

location /.well-known/openid-configuration {
    rewrite ^ /index.php/apps/openidconnect/config permanent;
}

Not the solution I wanted but it works.

1 Like

"Aaand I’m back with the more or less the same problem. Let me explain:

The solution above only worked because of a bug in the ownCloud desktop client v5.0.0-beta.1 and 5.0.0-beta.2. (Desktop client login via keycloak fails · Issue #11254 · owncloud/client · GitHub)

So, I read the documentation again in the section “Set Up Service Discovery” of the Admin Manual => Configuration => User => OpenID Connect article, where the redirect setup is explained.

(Last time, I didn’t understand which file the documentation was talking about and tried the .htaccess approach.)

I tried changing the bespoke ‘/etc/apache2/sites-enabled/default.conf’ after I activated the listed Apache modules rewrite, proxy, proxy_http, and proxy_connect.

After I restarted the container, the rewrite module was listed as deleted in the ‘mods-enabled’ directory. The lines I pasted into the default.conf were gone too.

So, my questions are:

  1. How do I prevent the module from being deleted?
  2. How do I make the changes in the default.conf persist?"

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.