bitwarden / android

Bitwarden mobile app for Android.
https://bitwarden.com
GNU General Public License v3.0
6.38k stars 797 forks source link

[Android] Auto-fill doesn't work on Samsung browser Stable and Beta. #895

Closed the4anoni closed 4 years ago

the4anoni commented 4 years ago

Describe the Bug

Like in topic

Steps To Reproduce

Try to login via auto-fill on Samsung browser.

Expected Result

Bitwarden auto-fill suggest you to fill passwords.

Actual Result

There isn't suggestion to auto-fill login and password

Screenshots or Video

Screenshot_20200510-223101_Samsung Internet

Environment

mpbw2 commented 3 years ago

Could you give us a "beta" version that has a forged package name until Samsung has finally fixed this?

That would be a bad idea for lots of reasons that are beyond the scope of this issue. :)

douglasparker commented 3 years ago

Is there anything that we can do to help get their attention? Is there no way to get in contact with an engineer that maintains the Samsung Browser?

Surely there is some channel for communication, or someone with contacts within Samsung?

From what I understand it works fine with other password managers.

Would a smaller company like AgileBits be willing to provide insight on this issue? I know they're Bitwarden's competition, but it would be nice for someone to help for the "greater good" of providing a safe and secure web.

Phangan commented 3 years ago

@mportune-bw Sorry, I forgot to add some irony, don't take this too seriously! ;)

mpbw2 commented 3 years ago

@Phangan Understood, lol :)

So I just updated to Samsung Internet 14 stable, and Autofill is working and even supports inline via the Samsung keyboard. Both of these things are something I never expected to see. Anybody else? (I'm on an S10 w/ Android 11)

Tosko4 commented 3 years ago

@mportune-bw as you can see in the version numbering here: https://github.com/bitwarden/mobile/issues/895#issuecomment-822058758

I've been rocking 14 stable but experience the bug. So annoying. The dev has it all working and users have issues xD

mpbw2 commented 3 years ago

@Tosko4 Bummer, mine is the same browser build. The only difference is I'm running an internal build of Bitwarden (2.9.2) but I don't believe anything autofill related has been touched since 2.9.1. Hopefully I can get a beta out relatively soon in case i'm wrong.

douglasparker commented 3 years ago

So I just updated to Samsung Internet 14 stable, and Autofill is working and even supports inline via the Samsung keyboard. Both of these things are something I never expected to see. Anybody else? (I'm on an S10 w/ Android 11)

It doesn't work for me at all. Only the accessibility service works for me.

Samsung Internet v14.0.1.62 Samsung Galaxy S21 Ultra (Android 11) Samsung Keyboard v5.2.40.0

mpbw2 commented 3 years ago

Just confirming - has everyone disabled the browser's built-in autofill settings in Internet Settings > Personal Data > Autofill forms (and the two switches in Usernames and passwords)?

douglasparker commented 3 years ago

Just confirming - has everyone disabled the browser's built-in autofill settings in Internet Settings > Personal Data > Autofill forms (and the two switches in Usernames and passwords)?

Yes, I disabled all of those settings a long time ago and I just confirmed that they are still disabled.

Thanks again for trying to help.

Samsung DeX mode on their latest tablets is really awesome and the DeX experience in the browser is also great.

I just can't bring myself to use the browser without proper support for Bitwarden.

Tosko4 commented 3 years ago

Just confirming - has everyone disabled the browser's built-in autofill settings in Internet Settings > Personal Data > Autofill forms (and the two switches in Usernames and passwords)?

Yep. All disabled

raghusundaram commented 3 years ago

@mportune-bw i found out when it stops working and what to do as a workaround to make it work again. When I go to the tab view in Samsung internet and open a new tab, i go to the login page of that particular website, and bitwarden doesn't work. When I close the samsung internet app and re-open it. It starts loading the login page of that particular website again and voila, bitwarden works.

Test scenario 2: when i open two new tabs with two different websited and go to the login pages of both websites, close samsung internet and reopen the app, then bitwarden works on both tabs. I can switch between the tabs and it remains working. When I close one of the two and the other one remains working until both tabs are closed and obviously to browse you need a new tab.

So, workaround for now is: when I reach a login page, close samsung internet and reopen. Even though this workaround works 100% of the time for me, it has become slightly annoying that I have to keep doing this. Is this a bitwarden or samsung internet app issue?

Versions Bitwarden: Version: 2.9.1 (3444) Samsung Internet: 14.0.1.62

Edit: also raised an issue with samsung regarding samsung internet app. So both parties can have a look at it. It seems to be more of an issue with Samsung Internet app than Bitwarden. As if theres a bug how Samsung Internet allows third party apps to use the auto fill feature. Because Bitwarden works fine on other browser apps (chrome, brave and above confirmed by other users: firefox etc)

The above solution works here. Bitwarden working natively.

yurividal commented 3 years ago

@Tosko4 Bummer, mine is the same browser build. The only difference is I'm running an internal build of Bitwarden (2.9.2) but I don't believe anything autofill related has been touched since 2.9.1. Hopefully I can get a beta out relatively soon in case i'm wrong.

Same build here. In-line autofill does "work", but, as stated before, it only works sometimes. In many occasions bitwarden does not recognize the website (it either identifies the website as being "--" or being "com.sec.android.app.sbrowser.beta") so you have to manually search for the site in bitwarden. Then, clicking the correct site, it also only actually fills in sometimes.

mdvmeijer commented 3 years ago

@Tosko4 This is the only substance in the reply. Awhile back we tested the theory that they were whitelisting 3rd party password managers instead of allowing use of the API across the board. I renamed the Bitwarden package name to match another popular password manager that we know works for sure with Samsung Internet, and viola - Bitwarden worked perfectly. We've made several attempts to contact Samsung to add Bitwarden to the whitelist, but we've never received a response.

From what I can see of the curent behaviour of the Bitwarden app, it seems to have been added to this 'whitelist'. Would you mind sharing how you managed to fix this in the end? I am running into the same issue with my own project.

yurividal commented 3 years ago

The weirdest thing is that, if you close Samsung browser (recents, swipe up) and relaunch it, bitwarden works and you get the inline autofill. It works for a while, and then after some minutes it stops again. So, it's definitely some sort of timer or timeout that is going on, that somehow kills the autofill service for the browser.

mdvmeijer commented 3 years ago

@yurividal So if I understand correctly, you still have problems with the Bitwarden autofill service in combination with the Samsung browser? I did some tests today of both the accessibility service and the autofill service with the browser, and they functioned as they should for at least 15 minutes (as long as I ran the tests) so the problem seems fixed on my end (most recent versions of Bitwarden and the Samsung browser)

douglasparker commented 3 years ago

@yurividal So if I understand correctly, you still have problems with the Bitwarden autofill service in combination with the Samsung browser? I did some tests today of both the accessibility service and the autofill service with the browser, and they functioned as they should for at least 15 minutes (as long as I ran the tests) so the problem seems fixed on my end (most recent versions of Bitwarden and the Samsung browser)

@mdvmeijer Only the accessibility service prompt pops up, and once in a while even that fails.

Samsung Galaxy S21 Ultra running Android 11 w/ One UI 3.1

yurividal commented 3 years ago

@yurividal So if I understand correctly, you still have problems with the Bitwarden autofill service in combination with the Samsung browser? I did some tests today of both the accessibility service and the autofill service with the browser, and they functioned as they should for at least 15 minutes (as long as I ran the tests) so the problem seems fixed on my end (most recent versions of Bitwarden and the Samsung browser)

Accessibility is completely disabled, to make sure I'm using autofill API. Autofill works with Samsung Browser only sometimes. It's like if the service has some sort of timeout. If you kill the browser (swipe up from recent) and relaunch the browser on the same page, autofill will work. After some minutes, it stops again. This only happens on the browser. For other autofill areas, such as apps, it works pretty consistently.

yurividal commented 3 years ago

It can also be related to turning the screen off, instead of an actual timeout.

yurividal commented 3 years ago

@mdvmeijer this video shows exactly what I mean: ezgif-1-27a8f283035f

mdvmeijer commented 3 years ago

I see, it indeed seems like there is still something interfering with the autofill service. Regarding the accessibility service and why I think Bitwarden managed to get into this "Samsung whitelist": When I just have the accessibility service of my own app running, no accessibility events are emitted by the app. Hence it can provide no functionality at all to the user if they are using the Samsung browser. However, if I enable the accessibility (or autofill, works for both) service of Bitwarden, the Samsung browser starts emitting accessibility events. These can then also be caught by my app. However, if I disable the Bitwarden service the browser stops emitting events again. Hence it looks like the Samsung browser notices whether Bitwarden is running, and based on that either emits these accessibility events or not. The same is the case with Dashlane and Lastpass: if either of them run, the browser emits events.

@mportune-bw Could you maybe shed some light on this or is this still a mystery to the team?

Tosko4 commented 3 years ago

I have the same issue as @yurividal , i mentioned this before in a previous comment. But I'd like to point out something. Might help troubleshooting, because we might be looking in the wrong area. It's not just Samsung Browser related. Other browsers have same issue with bitwarden, exactly the same as recorded in @yurividal his video. Such as, chrome, brave etc. Sometimes bitwarden recognizes the login field and shows the bitwarden button to fill in credentials. Other times it doesn't, I close the browser, reopen the browser and voila, bitwarden button is shown.

I believe the issue is not a compatibility problem with a specific browser, or a whitelisting issue, but more fundamental.

On my iOS devices I don't have issues with bitwarden, only on Android devices.

@MattTheDev @mportune-bw

mdvmeijer commented 3 years ago

@Tosko4 True, this sounds like a more fundamental problem separate from the whitelisting stuff. I can confirm from my own testing that this whitelist does exist however, and somehow Bitwarden managed to get on it (maybe someone at the Samsung browser dev team really likes Bitwarden :p). If someone on the Bitwarden team has any idea how you managed this then I'd love to hear it.

mpbw2 commented 3 years ago

@mdvmeijer Based on the power consumption used by accessibility (the event stream can be insane depending on the app) I would guess they stop emitting events unless an app is configured to receive them. I don't know this for sure, however.

@Tosko4 I would love to know the answer to this as well, since debugging shows our autofill service alive and well but simply no longer receiving events from the system.

@mdvmeijer We've tried to contact them in the past to get whitelisted but never heard anything back. Maybe they finally added us.

Tosko4 commented 3 years ago

@mportune-bw I tried putting the apps related to each other (Brave, Bitwarden, Chrome, Samsung Browser) in a never deep sleep mode.

The new power management on android creates a lot of issues so to say. Not sure if you were referring to that? I'd have no clue how I could help any further honestly. If theres anything I can provide, let me know

douglasparker commented 3 years ago

@mportune-bw I tried putting the apps related to each other (Brave, Bitwarden, Chrome, Samsung Browser) in a never deep sleep mode.

The new power management on android creates a lot of issues so to say. Not sure if you were referring to that? I'd have no clue how I could help any further honestly. If theres anything I can provide, let me know

I've excluded these apps from deep sleep as well and still have more issues with Samsung Internet than other Chromium based browser.

Honestly, why is autofill such a nightmare in Android? It's been a buggy mess for so long now.

yurividal commented 3 years ago

@douglasparker i think the reason why its a mess is because it depends on a proper and precise implementation from Browsers, Keyboards, and Password Providers. 3 different players have to work together to have it work properly. No wonder why the only proper implementation is on pixel phones using Chrome, GBoard and Google Password Manager.

mdvmeijer commented 3 years ago

@mdvmeijer We've tried to contact them in the past to get whitelisted but never heard anything back. Maybe they finally added us.

@mportune-bw Thank you for your reply. Do you know which channel was used to try to contact them? Then I will try my luck as well.