android / input-samples

Multiple samples showing the best practices in input on Android.
Apache License 2.0
288 stars 265 forks source link

Providing a Uri Suggestion for Autofill #25

Closed WilliamABradley closed 4 years ago

WilliamABradley commented 6 years ago

Hi there, I'm writing an app that accesses a user's server from their provided Uri. To authenticate, I show a Credential Dialog. How could I associate the uri of their server with the EditText for Autofill?

Currently I'm using the LastPass Fill Helper, (Pre-Oreo), and it tries to search for logins using my App's PackageName, which obviously won't return any helpful results.

Obviously, I can't do any App associations because the Server is not mine and out of my control.

fung1996 commented 6 years ago

Help me

the-felipeal commented 6 years ago

I think the best approach here would be to "emulate" WebView and call setWebDomain(serverUri) in the view group object that wraps the EditTexts.

Notice that this won't guarantee the autofill service will provide the credentials, as your app is not associated with that server (as you described). In fact, the service should NOT automatically autofill your app, but it could provide a dialog warning the user about the mismatch and asking for confirmation.