[BUG] 2FA not working on versions 2.0.4, 2.1.0+
Description
After updating Android client to 2.0.4, 2FA stopped working. Same code returns "Invalid 2FA code" on Android client, but works in the webclient/browser on desktop computers or smartphones.
Devices and Versions
Your Rocket.Chat.Android version: 2.0.4 Your Rocket.Chat Server version: 0.63.3
Mobile device model and OS version: Huawei P10 Lite - Android 7.0
Steps to reproduce
- Sign in to the server
- Login - login credentials are accepted
- 2FA code prompt appears
- After copy&pasting 2fa code from authy, app returns "Invalid 2FA Code" message
Cheers, Dragan
@dragans Is your device clock synced correctly?
Hi. Yes, it is synced to my mobile network operator clock and the time is in sync with the rchat server too.
That was first thing that came to mind also.
I also tried increasing the 2FA delta in the server settings and reinstalling the mobile app, but no luck :)
@dragans Can you check version 2.1.0 that we just released to the store?
Still the same unfortunately. I also updated the server version to the 0.64.1.
I forgot to try it before, but trying the generated 2FA backup codes also doesn't work on mobile.
Just tried testing 2FA on the colleagues phone too, same result.
Mobile device model and OS version: OnePlus 3T - Android 8.0
@dragans Have you checked if your server's clock configured correctly? I can use 2FA normally here on my device. Can you try using our server with 2FA? https://open.rocket.chat. Thanks!
I tried with https://open.rocket.chat/ and it works OK, so it seems it's something related to our setup.
It's weird that 2FA code works in browsers on the mobile devices, but not in Android app (with our server). I checked timezone and time on the server, everything is configured correctly and time is synchronized.
Any tip on what else could be the problem maybe? :)
Nothing was changed on the server, except that I updated to the latest stable. Before switching to the new Android app, 2FA worked OK.
@dragans Could you please try removing 2FA from your account and adding it again?
Tried that several times too :)
EDIT: For reference, here are timezone settings that are set on the server and my android device.
Server: Europe/Belgrade (Central Europe Standard Time); Ubuntu 16.04 server Android device: Uses mobile network-provided time, automatic timezone settings, current timezone is GMT+02:00 Central Europe Standard Time
@rafaelks I'm also experiencing this problem. And actually, I tried connecting to open.rocket.chat with 2FA via the Android App. I'm also getting a similar error "Invalid Code". So I'm getting similar responses when I try to connect to our self-hosted instance, and yours.
Hello, I'm having the same issue. None of our users in our rocket.chat instance can't use 2FA in Android. In the web everything works flawless.
Server version: 0.65.1 Android Version: 2.3.2 build 2026 (available in the Google Play store)
Guys, we're investigating the issue and we'll get back to you soon with a resolution. 👍
Very hard to get this bug @dsgagi @earlng and @masterdbpereira I tried here several times with our open.rocket.chat server and didn't get the bug. Have a look: https://drive.google.com/file/d/11EzwTSIN6PEbvSEY2TPQqhqqqXelbDMj
Could you try again and let me know if it is happening yet to you guys?
c/c @rafaelks
Thing is, Android 2FA works for open.rocket.chat server but not for our self-deployed server.
2FA codes work for web and desktop clients, just not for the Android app. Not sure if the same happens for iOS app, didn't have an opportunity to test it.
Maybe the Android app was hardcoded with open.rocket.chat for 2FA code validation during testing and left with that change? :)
@dsgagi Validation is done server-side not client-side. What's your server URL so we can give it a try and debug on the API-side?
@rafaelks I am sending you credentials for our server, as public registrations are not opened.
Any ETA for 2FA being functional on the native Android apps? Seems silly that we can't use this yet.
@HammyHavoc @dsgagi Tried with several devices on @dsgagi and works for me. Really can't understand why it doesn't work for you guys. Can you all try different timezones? Setting up a new key maybe? Thanks!
@rafaelks I don't know whether or not it works, I was assuming that this message wouldn't be here if it did work:
@HammyHavoc That message is little misleading :)
There were two versions of Android apps on Play store, Rocket.Chat+ and Rocket.Chat.
Rocket.Chat+ is an old app and is now deprecated, but some users are probably still using it. It also doesn't support 2FA.
https://play.google.com/store/apps/details?id=chat.rocket.android&hl=en - this one is currently supported and has 2FA support too.