-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid QR code on Edge during first login of a user #1147
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I think this is a regression of nextcloud/server#28725, similar to nextcloud/twofactor_nextcloud_notification#551 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@ChristophWurst Are you sure, because for me the real QR code does show, but only if the user hasn't generated backup codes before. If a user has generated codes the QR code only says "undefined". |
I'm trying to allocate time to look into this, but failed to find this time so far. |
Same problem here: Upgraded to 22.2.0. New user logs in for first time, prompted to scan QR Code. Tried scanning QR Code with multiple authenticator apps and they fail to recognize the QR code. Existing users with TOTP setup still work... |
Upgraded today to 22.2.1 and the problem remains... |
The ticket is still open. So yeah, this is not fixed. |
I can confirm the issue. One of my new clients is seeing the same failure on 22.2.1 after the first login. |
Christoph since this is a major issue which affect organisations with a lot of users, do you plan to look it soon? i know that maybe you are busy with other thinks but it seems this cannot work with us anymore for security issues thanks in advance |
As I said, I'll look into it. The most probable cause for this regression is linked. Feel free to debug it in the meantime and share your findings with us. |
From what i found is that at the first login the created QR code for TOTP is invalid... ( the scanned barcode did not include a valid account) |
Upgraded to 22.2.2 and problem still remains. On a side the note, the QR code looks smaller / squished to me, which is different than what I’m used to seeing. Anyone else agree with this statement? EDIT |
Could you check the HTTP response of the request that checks the code? What HTTP status does it return? What's does the response body say? |
I am using ios app. how can i debug the app? the only way to setup Wireshark in my router. is there any other way to check the response from mobile OTP Auth app? |
Log in from your desktop browser instead and open the browser console. That will allow you to inspect. |
already did this. no response while i scan the barcode through the browser |
But how can the code be invalid then? There must be a request that sends your input to the server. |
Maybe there is a misunderstanding. The issue appears BEFORE you interact with the server. BEFORE you verify the 2FA-Code for the first time. The QR-Code itself is broken and the TOTP-App (like Google Authenticator etc.) says after the scan, that there is a problem. |
Right. I'm mixing things up with #1153. |
The code also seemed very small to me. So I've scanned it with a trusty QR scanner (ZXing) on my phone. The code's content is Anyway, I hope that bit of info might help to track down the root cause of the problem. |
It must happen somewhere around twofactor_totp/src/components/LoginSetup.vue Lines 66 to 73 in 7d769b3
There should still be a request to |
I just upgraded to 22.2.3 and this is now working. I've tested this in Firefox and Chrome and the code generates properly, but does not generate properly in Edge (Version 95.0.1020.53). Checking the dev tools in Edge, I see the following error: Refused to execute script from 'https://WEBSITE.com/login/selectchallenge?redirect_url=/core/js/oc.js?v%3D79d760e5' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. (main.js). When I look at the dev tools in Chrome / Firefox, this message does not appear. |
I can confirm that is working with 22.2.3 in Firefox and Google Chrome, but is not working with Edge and Safari on Mobile. I dont know why :)
|
Check again. Is it possible that for you some scripts are not loadable? |
In Chrome: {state: 1, secret: "BCARNCFBFTQBM3QB",…} In Edge: No response |
First insight is that the generated URL is simply wrong. |
any clue why this is happening? |
|
This is a regression of nextcloud/server#28725 |
https://github.com/nextcloud/server/blob/e272ac258ae3a14dd27335e03c7eab1fae355b7b/lib/private/TemplateLayout.php#L234-L239 explains why this only shows with Edge. Edge does not support CSPv3 and therefore we have to load config via a fake script, for the other browsers we can directly inject the js config. |
I just tested with Edge through Sauce Labs and can proof that the issue is gone with nextcloud/server#29752. Nevertheless I would highly appreciate if someone could test this patch on their production system. You find instructions at https://docs.nextcloud.com/server/latest/admin_manual/issues/applying_patch.html#getting-a-patch-from-a-github-pull-request. Patch your Nextcloud server and the issue should be gone 🙏 |
I can confirm that is working now with Edge. i Patched my server and is working 📦 |
I'm having this issue but with all the browser (tried with Firefox and Chrome) and on ios and Android. |
Open a new ticket. |
Done: #1172 |
Steps to reproduce
Expected behaviour
During the first login of a user the MFA is enforced and there is a QR Code for scanning. The user should be able to scan the code in the OTP Auth app and reproduce codes for login
Actual behaviour
The problem is that if you scan the QR Code during the first login it says that is invalid code. Before at 22.1 was working fine. I tested a lot of Authenticator apps and all the same error (invalid QR code). If i disabled the MFA for this user, the user can login normally and through his security settings if he enables MFA the created QR code is working. The problem is with the QR code during the very first login!
Server configuration
Operating system: Linux 5.4.0-65-generic x86_64
Web server: Nginx
Database: Mysql
PHP version: 7.3.27
Version: 22.2.0
Updated from an older version or fresh install: Updated
List of activated apps:
The content of config/config.php:
Client configuration
Browser:
Operating system:
Logs
Web server error log
Server log (data/nextcloud.log)
Browser log
The text was updated successfully, but these errors were encountered: