keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

Frequent OneDrive authorization request

Open wombat01 opened this issue 7 years ago • 53 comments

Since version 1.08 (pre3), it is necessary to confirm authorization on OneDrive almost every time I want to open it.

https://i.ibb.co/nr91Bc1/x-Screenshot-Nov-13-2019-3-11-49-PM.png

wombat01 avatar Nov 13 '19 14:11 wombat01

Same issue here with version 1.07b-r0.

I use Microsoft authenticator, maybe that is the reason.

Pablo

parovi01 avatar Nov 13 '19 21:11 parovi01

I have the same or a similar problem - Every time when the app is started fresh and it tries to access the database on Onedrive for Business I get an Onedrive Authentication Message "Pick an account" (I use different O365 accounts for different purposes). Then I select the account where my keepass DB ist stored, Next I get a message "Are you trying to sign in to Keepass2Anfroid?" (this seems to be the same screen as wombat01 posted above) and I click "Continue". Then the sync works (I do not hae to selected the databse again). However these authentication dialogs keep coming back every time the app is restarted.

J-O-P avatar Nov 25 '19 20:11 J-O-P

Already described the problem when the offline access bug was fixed: here There is also a log file.

towadroid avatar Dec 03 '19 08:12 towadroid

For me this pops up about one time a day.

priv avatar Jul 28 '20 08:07 priv

Since the last update 1.08b-r0, everything seems to be fine.

wombat01 avatar Jul 29 '20 09:07 wombat01

I am using 1.08b-r1 and I get inconsistent behavior. The only scenario I am able to reproduce is the following: The authorization window pops up every time if 1) the app has been stopped forcefully and 2) there is an internet connection when opening the app.

However I have also experienced that I could not access my database without an internet connection at all because the app tried to authorize onedrive access.

towadroid avatar Sep 17 '20 13:09 towadroid

Like @J-O-P I have 2 OneDrive accounts, and I often get a prompt when opening the database asking me which account I want to use. (The 2nd account is not on my Android device, has never been used in the app.) I speculate that this is being triggered by Microsoft, which knows that I have more than one account from my desktop activity.

JNavas2 avatar Oct 13 '20 00:10 JNavas2

Just switched from Dropbox to Onedrive sync and also having this issue with 1.08b-r1.

Mercerudy avatar Oct 28 '20 13:10 Mercerudy

Since my earlier comment I've paid more attention to this problem, and it seems to be related to the quality of my Internet connection. It never seems to happen on a solid Internet connection, just when I'm on a bad connection with poor speed and high latency. And when the issue occurs, I can open my database without new authorization by backing up and trying again. My guess is that authentication is timing out, and that the app assumes it's an authentication error, so opens a new unnecessary authorization. That would seem to be a possible bug or at least poor error recovery.

JNavas2 avatar Oct 28 '20 21:10 JNavas2

I've also noticed that I can just back up and try again, successfully opening the database. I assumed that I was just working with local cache, but what you're saying makes sense @JNavas2.

Mercerudy avatar Oct 29 '20 01:10 Mercerudy

Video showing unnecessary OneDrive authorization: [DELETED, SEE NEW VIDEO BELOW]

JNavas2 avatar Oct 30 '20 20:10 JNavas2

I enabled logging, and reproduced the problem. Log file attached (OneDrive details deleted). Keepass2Android.log

JNavas2 avatar Oct 30 '20 20:10 JNavas2

Video showing issue: https://youtu.be/jGcLJiKc77I Starts with fingerprint (not captured) opening of database. App opens database [see capture below], but displays OneDrive authorization screen. Single back touch then displays open database.

Screenshot_20201031-092236

JNavas2 avatar Oct 31 '20 16:10 JNavas2

a user noted that the authorization request happens after updating the file from the Windows client. this might help diagonising this.

PhilippC avatar Nov 09 '20 11:11 PhilippC

It happens for me even when the local android device was the last to update the file.

Mercerudy avatar Nov 09 '20 13:11 Mercerudy

This is very strange behavior. Even if you just close this dialog, file is still synchronized correctly. The re-auth is just unnecessary.

priv avatar Nov 10 '20 04:11 priv

@PhilippC

a user noted that the authorization request happens after updating the file from the Windows client. this might help diagonising this.

See my video and log. The behavior was not after a Windows update of the file.

JNavas2 avatar Nov 10 '20 04:11 JNavas2

I'm not saying this is the only option how to produce this, but in my previous tests I wasn't able to reproduce this behavior (which makes it very difficult to fix), so I thought this might be a good hint for me when fixing.

PhilippC avatar Nov 10 '20 18:11 PhilippC

@PhilippC It can be hard to reproduce, but the problem appears to entirely be a function of what's happening on the phone, not anything external. How I reproduce it (how I got the log file and video I posted):

  1. Reboot the phone
  2. Wait a few minutes until the reboot dust has settled
  3. Open the database on OneDrive.

I just did it again to confirm that it does reproduce the problem.

JNavas2 avatar Nov 10 '20 18:11 JNavas2

Since my earlier comment I've paid more attention to this problem, and it seems to be related to the quality of my Internet connection. It never seems to happen on a solid Internet connection, just when I'm on a bad connection with poor speed and high latency. And when the issue occurs, I can open my database without new authorization by backing up and trying again. My guess is that authentication is timing out, and that the app assumes it's an authentication error, so opens a new unnecessary authorization. That would seem to be a possible bug or at least poor error recovery.

@JNavas2's hypothesis from a couple of weeks ago^ fits my observations as well. Is there no reason to think that a premature authentication timeout might be the culprit? @PhilippC

Mercerudy avatar Nov 10 '20 19:11 Mercerudy