Rocket.Chat.Android icon indicating copy to clipboard operation
Rocket.Chat.Android copied to clipboard

[BUG] 2FA not working on versions 2.0.4, 2.1.0+

Open dsgagi opened this issue 8 years ago • 36 comments

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

  1. Sign in to the server
  2. Login - login credentials are accepted
  3. 2FA code prompt appears
  4. After copy&pasting 2fa code from authy, app returns "Invalid 2FA Code" message

Cheers, Dragan

dsgagi avatar Apr 30 '18 14:04 dsgagi

@dragans Is your device clock synced correctly?

rafaelks avatar Apr 30 '18 14:04 rafaelks

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 :)

dsgagi avatar Apr 30 '18 14:04 dsgagi

@dragans Can you check version 2.1.0 that we just released to the store?

rafaelks avatar May 03 '18 21:05 rafaelks

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.

dsgagi avatar May 04 '18 07:05 dsgagi

Just tried testing 2FA on the colleagues phone too, same result.

Mobile device model and OS version: OnePlus 3T - Android 8.0

dsgagi avatar May 04 '18 12:05 dsgagi

@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!

rafaelks avatar May 07 '18 09:05 rafaelks

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.

dsgagi avatar May 07 '18 09:05 dsgagi

@dragans Could you please try removing 2FA from your account and adding it again?

rafaelks avatar May 07 '18 12:05 rafaelks

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

dsgagi avatar May 07 '18 12:05 dsgagi

@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.

earlng avatar May 23 '18 06:05 earlng

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)

carlosmbpereira avatar Jun 15 '18 10:06 carlosmbpereira

Guys, we're investigating the issue and we'll get back to you soon with a resolution. 👍

rafaelks avatar Jun 15 '18 14:06 rafaelks

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

philipbrito avatar Jun 29 '18 18:06 philipbrito

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 avatar Jul 02 '18 07:07 dsgagi

@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 avatar Jul 02 '18 12:07 rafaelks

@rafaelks I am sending you credentials for our server, as public registrations are not opened.

dsgagi avatar Jul 02 '18 14:07 dsgagi

Any ETA for 2FA being functional on the native Android apps? Seems silly that we can't use this yet.

HammyHavoc avatar Jul 04 '18 22:07 HammyHavoc

@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 avatar Jul 04 '18 22:07 rafaelks

@rafaelks I don't know whether or not it works, I was assuming that this message wouldn't be here if it did work: capture

HammyHavoc avatar Jul 04 '18 22:07 HammyHavoc

@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.

dsgagi avatar Jul 04 '18 23:07 dsgagi