nextcloud / user_external

👥 External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
107 stars 64 forks source link

Nextcloud v23 support #186

Closed dodedodo closed 2 years ago

dodedodo commented 2 years ago

External User Backends (user_external) supports nextcloud 21 and 22, but not yet 23.

Is support planned?

Has anyone tried to enable this app on nc23 despite the lack of official support?

EDIT: The official nextcloud v23 documentation points to this unsupported app

Glandos commented 2 years ago

I updated my Nextcloud to 23, and re-activate user_external after setting max_version to 23. I was able to log in in a private window.

I am using the IMAP backend.

fagidutt commented 2 years ago

Can second this, using IMAP auth, re-enabled user_external via occ after upgrading to 23. No errors visible and backend auth is working as it should. However, someone should probably have a closer look to possible exceptions to make sure it really is compatible. I didn't see any problems so far, however.

pelzvieh commented 2 years ago

Same with OC_User_BasicAuth, appears to work (login possible, no obvious problems so far).

ltdaydo commented 2 years ago

Can anyone login with IMAP in Nextcloud v23 ? I'm using Nextcloud v 22.2.3 and i want upgrade to v23.

GottemHams commented 2 years ago

I'm using FTP here and there are a few problems:

Some debug logs for the second issue:

"app":"user_external","method":"PROPFIND","url":"/remote.php/dav/files/myuser/","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead."

"app":"core","method":"PROPFIND","url":"/remote.php/dav/files/myuser/","message":"could not get login credentials because the token is invalid"

"app":"core","method":"PROPFIND","url":"/remote.php/dav/files/myuser/","message":"Login failed: 'myuser' (Remote IP: '123.123.123.123')

"app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/myuser/","message":"No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect"

"user":"--","app":"core","method":"","url":"--","message":"could not get login credentials because session is unavailable","userAgent":"--"

"user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for OC\\AccountManager::userUpdated: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--"

"user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OCA\\DAV\\CardDAV\\CardDavBackend::updateCard: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--"

I'm not sure where the no app in context lines come from though, it might be the Auto Groups app. But it appeared around the same time as the other errors so it might actually be from the External user authentication app after all.

2FA works fine for external users, by the way.

CarlBishop commented 2 years ago

Just tested, it works but of course not supported

d307473 commented 2 years ago

Can anyone login with IMAP in Nextcloud v23 ? I'm using Nextcloud v 22.2.3 and i want upgrade to v23.

Yes, works fine for us with Nextcloud v23.0.2

MarBie77 commented 2 years ago

I always had some troubles with "OC_User_IMAP class not found" errors on upgrades (after changing the XML). I figured that it seems to be the usage of old OC class list (prior Nextcloud 20, see comment above about app.php). To solve the problem I forked this repo and added the current nextcloud framework Application class: https://github.com/MarBie77/UserExternal

Maybe it works for you too, if you have the same errors I had. Though I only need the IMAP part. The others are untested. I also had to change the namespace and class names, so I don't get conflicts with this app.

Thom1b commented 2 years ago

Hi, nextcloud-23.0.3r1 is released. Do you think this app will be update before 23.0.3 release?

dodedodo commented 2 years ago

I always had some troubles with "OC_User_IMAP class not found" errors on upgrades (after changing the XML)....

@MarBie77 Maybe this issue should be tracked in a separate thread. Could you create that? (if it doesn't exist already)

MarBie77 commented 2 years ago

@dodedodo There is no issue for me anymore. I solved it by upgrading a fork of this app. If I should create a PR, just let me know.

son1x commented 2 years ago

As there is still no update on the plugin, is there a forked version including signature? :)

GottemHams commented 2 years ago

I always had some troubles with "OC_User_IMAP class not found" errors on upgrades (after changing the XML). I figured that it seems to be the usage of old OC class list (prior Nextcloud 20, see comment above about app.php). To solve the problem I forked this repo and added the current nextcloud framework Application class: https://github.com/MarBie77/UserExternal

Maybe it works for you too, if you have the same errors I had. Though I only need the IMAP part. The others are untested. I also had to change the namespace and class names, so I don't get conflicts with this app.

I tried this but there were quite some problems when installing the fork. Since you haven't enabled issue tracking on your fork I'll have to describe it here: Running ./occ app:enable UserExternal gives App not found. The id within the appinfo XML is still user_external so that's actually what you should pass as the app name. But when I enabled it Nextcloud stopped working entirely: {"user":"myuser","app":"PHP","method":"GET","url":"/","message":"Cannot declare class OCA\\UserExternal\\AppInfo\\Application, because the name is already in use at /apps/UserExternal/lib/AppInfo/Application.php#14","version":"23.0.2.1"}

After disabling the app again I decided to change all references to user_external to UserExternal as well: cd apps/UserExternal && sed -i 's/user_external/UserExternal/g' lib/*.php Makefile tests/*.{xml,php}. Then opened appinfo/info.xml for editing and changed these 3 tags:

<id>user_external</id>
<name>External user authentication</name>
<version>2.1.0</version>

To:

<id>UserExternal</id>
<name>External user authentication (FORK)</name>
<version>2.1.1</version>

The name and versionI only changed so I could easily tell the original apart from this one, just in case. There was one more problem:

{"user":"myuser","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"Cannot declare class OCA\\User_external\\Migration\\Version0010Date20200630193751, because the name is already in use at /apps/UserExternal/lib/Migration/Version0010Date20200630193751.php#0","version":"23.0.2.1"}

So one more thing was misnamed: namespace OCA\User_external\Migration; which should've been namespace OCA\UserExternal\Migration;. After all this I could finally enable it without any errors and log in again with my FTP user. Unfortunately though your version doesn't fix the particular issue I'm having. ;_;

MarBie77 commented 2 years ago

@GottemHams Sorry, I fixed the namespace of the migration class and changed the appinfo.xml accordingly. Also increased the max-version for nextcloud to 23.

Though your problem seems to be, that you enabled 2 apps of UserExternal (see "occ app:list") in the same directory, a result maybe, because you manually edited the appinfo.xml and you didn't disable the old one before? Because of this I would disable and remove all apps, clear all caches and add the UserExternal app again. You may have to change appinfo.xml manually again to disable the old one.

@all sorry for the spam, I had to answer here, because GitHub didn't let me reference with the new issues page of the fork. Please post there, if anything else needed for the fork.

GottemHams commented 2 years ago

No it actually already was a problem with the original app, which I did disable before installing your fork (I even removed the old one entirely beforehand just to make a 100% sure). I just wanted to check if your fork happened to fix my primary issue (desktop client logging me out after a couple of hours), I think your first comment here was directed at me as well? :> But it looks like the cause was not simply incompatibility with Nextcloud 23.

If you were referring to the other issue (500 HTTP error on login with a "new" FTP account), that had a different cause: apparently Nextcloud doesn't like certain symlinks for the data directory, so I just made it a bind mount instead and that solved that problem. =] For some reason I only noticed in the logs this time around.

CarlBishop commented 2 years ago

Doesn't work any more with latest 23.0.3. Since it seems the app to be abbandoned, does someone know hot to migrate users from OC_User_IMAP to standard database backend without losing user data?

Thank you

fagidutt commented 2 years ago

I have it enabled on latest. Seems to work. I'm using IMAP method and i just checked. The request is received by the IMAP server. Valid logins work, invalid don't. So far everything seems fine. Didn't check the NC logs deeper however. Since i force-enabled the plugin for earlier versions already, i didn't have to reenable it.

simaoafonso-pwt commented 2 years ago

I have it enabled on latest. Seems to work. I'm using IMAP method and i just checked. The request is received by the IMAP server. Valid logins work, invalid don't. So far everything seems fine. Didn't check the NC logs deeper however. Since i force-enabled the plugin for earlier versions already, i didn't have to reenable it.

Can confirm this too, I'm using the IMAP backend too. This is just a metadata issue.

CarlBishop commented 2 years ago

Seems to work but it doesn't, after a while I get 500 error with that logs:

[user_external] Error: ERROR: Could not connect to imap server via curl: Resolving timed out after 10000 milliseconds

and then:

[index] Errore: Unable to verify user XXXXXX

fagidutt commented 2 years ago

That sounds interesting. First of all i must say clearly, that i'm neither a NC App developer nor do i possess any deeper knowledge into NC's app structure at all. However, getting a curl timeout, i have doubt that this is caused by the plugin itself. Especially since it only happens after some amount of time. Finding the exact issue causing this might be not too simple, as it could be caused by a malfunction or misconfiguration anywhere between the nextcloud implementation of curl, or the php implementation (ie. the php-curl module being misconfigured) of it respectively, DNS used for queries by your nextcloud instance server, to the authoritative name server of the MX you are trying to resolve. I remember having had issues with nextcloud regarding curl errors and dns resolving. however i can, for the best of mine, not remember if that was related with auth_external or what i did to fix it. but i mean to remember that it came down to misconfiguration of php-curl or my authoritative NS, which i had to change something for it to start using the right resolvers (or resolvers at all), so maybe this could be a lead...

Good luck

CarlBishop commented 2 years ago

Thanks, of course the mx/dns is the first idea, but NC and imap server are on the same host and there wan no errors with version 23.0.2

By the way I don't want to use something not supported any more so I'd like to move user account backend from IMAP standard NC database.

Edit. With Roundcube on the same machine I have no error at all.

a575606 commented 2 years ago

I'm using SMB and managed to get it working on 23.0.3 by changing max-version number in appinfo/info.xml. Seems stable after restarting the nextcloud container. But yes, I do hope the app continues to be maintained. I really prefer this solution than trying to get LDAP working.

EDIT.... Oops. Looks like I spoke too soon. Password authentication for SMB users isn't working, but those users can still log in by device. Hmmm...

goapunk commented 2 years ago

with nextcloud 23.0 being the official stable release, that's quite the blocker. Any chance to get this fixed ? cc @violoncelloCH @ChristophWurst :)

ChristophWurst commented 2 years ago

I'm not a maintainer of this app.

goapunk commented 2 years ago

I'm not a maintainer of this app.

Sorry, ignore this then :) Since you merged the last PR on this I assumed you might be one

pm-pm commented 2 years ago

I'm not a maintainer of this app.

Ok, who is the maintainer of this app?

maphy-psd commented 2 years ago

i think @violoncelloCH is the maintainer of this app. maybe he has left the project?!?

@MarBie77 can you create a pull request and adopt this app?

Aquariu commented 2 years ago

Dear all,

At this point this app is the last one preventing me to safely upgrading to NC23.

As a "simple" user/admin, and looking at Nextcloud's maintenance schedule, I feel like NC22's end of life in July may come faster than we imagine. specially if someone at NC needs to take over maintenance of the app (which is an unknown at this point).

Innocent questions: Are there so few of us using this app ? Should we ask NC to take over it as an official app ?

Regards,

Olivier

simaoafonso-pwt commented 2 years ago

At this point this app is the last one preventing me to safely upgrading to NC23.

I was also fearful, but did it anyway, and just changed the metadata. This is not an incompatibility in the code, only on the metadata. I opened #188 to do this change.

violoncelloCH commented 2 years ago

Yes, I'm the one who's last maintained this app and I'll still try to continue doing so, however I'm currently extremely busy with my studies. I hope to do some testing and try to create a new release this week-end...

(Please note that I've always just been a community contributor)

skjnldsv commented 2 years ago

Please note that I've always just been a an amazing community contributor

FTFY :wink:

violoncelloCH commented 2 years ago

I've just released a beta with support for Nextcloud 22 up to 24 (v3.0.0-beta1). You can either manually download and install the archive from https://apps.nextcloud.com/apps/user_external or you can use occ to update user_external to this unstable version occ app:update user_external --allow-unstable (check the documentation on how to use occ) Please check the release notes / changelog for an explanation on the breaking change (modification to your config.php are needed when updating).

binarykitchen commented 1 year ago

@violoncelloCH is this fix still in beta phase after one year?

violoncelloCH commented 1 year ago

@binarykitchen no, v3.0.0 (non beta) has been released as you can see here: https://apps.nextcloud.com/apps/user_external