-
Notifications
You must be signed in to change notification settings - Fork 26
U2F API is being deprecated #947
Comments
so this app doesn't have to die yet, we just have to change the way we access the devices if I understand correctly. |
we'll have to see if it makes more sense to migrate from webauthn to u2f here or invest into webauthn as full first and second authentication method as per nextcloud/server#21215 and deprecate this app entirely |
I think having WebAuthn in U2F style as second factor still has some use especially considering external storage kinda breaks down on passwordless if it's set to use the user's credentuals. the good thing is that migrating credentials really doesnt seem to be hard. so for example while I use this block (simplified) on U2F (using Yubico's JS lib):
yeah it's not pretty but I had made this in a sandbox project, whatever requesting something from the same credential over Webauthn goes a little like this (also simplified):
there are 3 things to note:
as backend any decent webauthn backend should work but might need accomodation for the fact that the App-ID obviously changes the hash of the "site" that has been signed for. basically you need to check if the clientdatajson->extensions has the appid active and if yes basically make sure it doesnt check for the rpid hash but the appid hash. I on my simple sandbox setup basically just replace the rpidhash with sha256(clientdata->origin), as it already has been checked as a valid origin in the lib I use |
+1 here with this (a Vote to continue this Plugin just using WebAuthn instead of U2F). We use external storage which breaks using NC WebAuthn auth. Also when you configure WebAuthn from Nextcloud and have 2nd Factor forced for Users through the twofactor Plugin you first authenticate using WebAuthn from NC and then again through the twofactor module with the Security Key. Simply rely on Nextcloud only gives you not the possibility to enforce 2nd Factor and kinda breaks the ability to give TOTP as alternative 2nd Factor or backup codes. Looking at the current implementation (version 22) of NC WebAuthn only (as already mentionend in the Issue from NC) you enter the Username and use the Security Key. This is paswordless Login but not really a second Factor in my opinion. |
that's because they actually have set the UV method to discouraged so basically U2F-style but without password, which is a known issue. so as long as the sticks arent enforced to use UV (pin, biometrics or whatever to verify the user is the one intended) the second factor is sadly kinda needed |
I'm currently working on fixing this issue. However, I might need some technical advice. @My1 Let me ask you a question, as you seem to have some deep insights into Webauthn and U2F: Let's pretend I implement a feature that lets users migrate to Webauthn seamlessly. Do I need access to the U2F api for that? If so, it would result in bad UX because all users would have to migrate very soon. Or is it sufficient to use only the Webauthn API for that? If there is a need to access the U2F api for the migration, it would make more sense to completely deprecate |
the U2F API should not be needed anymore. In Fact I have a U2F frontend which have the yubico JS and PHP libs for the script and backend processing, as well as a WebAuthn side which is made with a modified copy of lbuchs/Webauthn as a backend (as that thing was obviously not built with U2F backwards compat in mind so I fiddled around, quite a bit), with a little js which is based on his sample, and both use a PHP script I threw on for the storage management and stuff. talking about storage here you might hit a snag, not sure if extensions on nextcloud are more or less isolated and especially if the data they make is just removed when uninstalling the extension, so maybe keep it running as twofactor_u2f but make it use webauthn. https://my1.dev/u2f/my1.php -> register and try to login (or not) here using u2f you just need to know/do a few things (non-exhaustive, I only wanted it to get running, this is a sandbox, not alcatraz):
and the rest should be doable by any decent webauthn implementation. |
twofactor_webauthn already exists: https://github.com/michib/nextcloud_twofactor_webauthn |
@ChristophWurst what's the plan for this now? |
@st3iny is having a deeper look. We'll update this ticket when we know more. |
That seems a bit late considering that this app is basically broken now for 90% of all users. Maybe add a prominent warning to the README and the NC APP store? |
I'm doing what's in my power to resolve this. The warning would not be read by many nor does it help anyone who's now logged out because of this. |
The API hast not yet been removed. For now, it has just been disabled. If required, the API can be enabled again at chrome://flags/#u2f-security-key-api. |
wait the API has been moved to flag-level disabled? wow. |
yes, I've been mislead with their warning. U2F doesn't stop after February, it stops working with the beginning of February … |
ouch. if you need any help with implementing Webauthn with U2F creds hit me up and maybe I can help, I dont think I can help with specific programming since it'll likely fail on every test about coding style and whatnot but I think I might be able to assist otherwise. |
Thank you very much @My1! Based on the information above and what @st3iny researched in addition we can bring over u2f registration to webauthn, so they continue to work in Chrome. Other browsers, like Firefox, seem to not be effected yet. Nevertheless there might come a point where they also drop this API due to the superseded webauthn standard and it would be cumbersome to support both standards simultaneously. The app @michib maintains seems to work nicely and it's quite familiar to the current twofactor_u2f due to their common code history. As we understand, there are two ways we can go
I will have to clarify internally. Nextcloud Gmbh also supports this app for customers. On that note, if you are a customer please drop us a ticket in the support system so we know you are affected. I'm sorry for any inconveniences caused. |
the entries are rewritten to the new format. we can't do this in a way where we guarantee this won't time out for the raspberry pi users and their 30s max request times, so I rather to the safe path and only offer things that we tested and now that work. |
Migration worked flawlessly on my personal instance, thanks for making this work! Also maybe worth adding that installing the app "Two-Factor WebAuthn" (obviously) needs to be done before attempting the migration. |
Many tanks, migration works fine. |
couldnt one do a set of migrations that's practically guaranteed to work within the time (e.g. 10) and then just trigger a 302 or whatever to the next set which has its own timeout? or whatever, the nextcloud updater can also work over web despite not nesecarily being done in 30 sec |
In theory, yes. Right now migrations happen synchronously in one batch, though. |
So the full flow to migrate from
That worked fast and smooth in my NC24RC3 instances. It displayed "Migrating devices of user XY" also for users that never hat a U2F device, but there already is an issue for that and it's cosmetics ;) In contrast to Thanks to all! |
Migration worked flawlessly in my personal instance for 7 users |
It works mostly well. We have some problems though: all devices are now registered twice (or in one case 3 times): Also, users cannot delete their old U2F devices and/or register them again. I guess this is due to the migration. I can provide database excerpts, if that helps. This is the stack trace when trying to remove a migrated U2F device:
|
@svenseeberg I think your problem has also been reported at nextcloud/twofactor_webauthn#176 |
Google Chrome is starting to deprecate the U2F API and is asking developers to use WebAuthn instead.
U2F devices are still supported through WebAuthn and existing U2F device credentials can be challenged through the WebAuthn API.
Also note that
Details:
https://groups.google.com/a/chromium.org/g/blink-dev/c/xHC3AtU_65A?pli=1
https://www.yubico.com/blog/google-chrome-u2f-api-decommission-what-the-change-means-for-your-users-and-how-to-prepare/
The text was updated successfully, but these errors were encountered: