rcdevs / nextcloud_openotp_auth

OpenOTP plugin enables Multi-Factor Authentication to login to Nextcloud Admin/User Pane
GNU Affero General Public License v3.0
6 stars 1 forks source link

Nextcloud 14 compatibility #3

Closed ChristophWurst closed 2 years ago

ChristophWurst commented 6 years ago

Hello app maintainers,

we made some changes to the Nextcloud 2FA logic that requires 2FA providers to populate their enabled/disabled state to the Nextcloud server, a.k.a making 2FA providers stateful. Before this change, the Nextcloud server used to load all provider apps and ask them if they are enabled for a given user. Since this doesn't work when an app is (temporarily) disabled or fails to load, we now use a registry that persists this state. In addition to a small performance improvement, this will allow us to enhance the 2FA mechanism for Nextcloud 15.

Please see the server changes at https://github.com/nextcloud/server/pull/9632 and update your app so that it registers the provider's state on the IRegistry whenever it changes.

As a reference implementation, you might find it helpful to check out the following apps which have been updated for this breaking change:

Let me know if you need more info about the required changes :wink:

Thanks for developing a 2FA provider for Nextcloud :rocket: :cloud: :closed_lock_with_key:

ChristophWurst commented 6 years ago

cc @rcdevs

ChristophWurst commented 6 years ago

:ping_pong: @rcdevs

Do you still maintain this app?

rcdevs commented 6 years ago

Hi yes yes it's still maintain, on our roadmap, in the upcoming weeks, thank you for your concern!

Julien

rcdevs commented 6 years ago

Hi, I'm gonna code the changes in our 2FA application, If I undestand well it will be mandatory for Nextcloud 14? I have some problem to find Nextcloud 14 to make my devs and test the futur changes, could you help me please? Thanks.

ChristophWurst commented 6 years ago

If I undestand well it will be mandatory for Nextcloud 14?

Yes.

I have some problem to find Nextcloud 14 to make my devs and test the futur changes, could you help me please? Thanks.

I'd suggest to set up a Nextcloud using the latest master. You can find more info on that at https://docs.nextcloud.com/server/14/developer_manual/general/devenv.html.

rcdevs commented 6 years ago

Hi, I've install nextcloud using last master, it's now a v.15.0.0alpha. I'd like to see twofactor_totp in action, so I dl last master from git, although I see a commit "Add Nextcloud 15 support" I all the time have a message "Could not enable TOTP"? Another point, could you help me to find the place where I can find all the changes I need to add to my code to populate the enabled/disabled state to the Nextcloud server, I'm not the best dev so it could be a little tricky... Thanks!

rcdevs commented 6 years ago

Idemn if I use nextcloud server git branch stable14 and twofactor_totp git branch v1.5.0, I can't enable TOTP, I'd like to have one twofactor provider working with state enable/diasble new feature, but for now i don't manage to...

ChristophWurst commented 6 years ago

As a reference implementation, you might find it helpful to check out the following apps which have been updated for this breaking change:

* https://github.com/nextcloud/twofactor_u2f

* https://github.com/nextcloud/twofactor_totp

* https://github.com/nextcloud/server/tree/master/apps/twofactor_backupcodes

^ see these three apps for reference. That's how I implemented it. There might be "simpler" approaches to it. All you have to do is geta reference to the IRegistry service (either by dependency injection or by querying the server container) and calling the corresponding methods. Hope this helped.

ChristophWurst commented 6 years ago

I'd like to see twofactor_totp in action, so I dl last master from git, although I see a commit "Add Nextcloud 15 support" I all the time have a message "Could not enable TOTP"?

Did you fully set up the app, e.g. did you run composer install?

rcdevs commented 6 years ago

No, I didn't, simply take the code from git, put it in /apps, I'm not familiar with composer, I'll try to run composer install

rcdevs commented 6 years ago

Works! Thanks