Aegis icon indicating copy to clipboard operation
Aegis copied to clipboard

Support for Autofill of OTP tokens

Open Neuro-NX opened this issue 6 years ago • 7 comments

Fundamentally, seeing as the token is just a string that can be copied to the clipboard, it may just be a matter of finding out how to share data between two apps.

This could possibly be done using Android autofill service.

  1. User signs into account in a browser or app
  2. Server makes request for OTP
  3. Autofill service updates UI with a call to action
  4. Prompts for dataset authentication, which will connect to Aegis vault
  5. Access is then granted

Neuro-NX avatar Jul 15 '20 04:07 Neuro-NX

Limitation: Android allows for only one autofill service to be active

There is a limitation to using autofill, as is, in that because it will parse all focused 'views' for autofillable fields, only one app can be assigned to do this job; possibly to prevent conflict errors.

Here are two possible workarounds that will not impact the flow, but still maintain a seamless interaction model.

  • Solution 1: Prompt the user to select Aegis as the active Autofill service, when OTP field is found in a focused view. Refer to Prompt to enable the service and here. Note that the prompt should trigger when autofill detects that a token is being requested.

  • Solution 2: Implement a Quick Settings tile that will toggle an activity to automatically perform the autofill selection change, but as a background process, to either activate or deactive the autofill service. --- This would be used for users who may be using a password manager as their active autofill service, and would want to only make Aegis the current autofill service when an OTP token is being requested.

Neuro-NX avatar Jul 15 '20 16:07 Neuro-NX

Examples of Autofill in use that use different interaction approaches.

  • Keepass2Android brings up a separate UI view where the user is prompted for authentication before the data is inserted.
  • Bitwarden uses a background process to copy the token to the clipboard, but requires the user to manually paste it into the field. No additional UI view is used.

I much prefer the way Keepass2Android has implemented their autofill, as it provides additional clarity to the user what is going on. For 2FA, you would create a new view, prompting the user to first unlock their vault, you can actually reuse and modify the UI view you already use for the 'Unlock the vault' screen. Autofill will then bring up a list of the user's URIs, once selected the token is copied to clipboard, then inserted in to the form field.

Neuro-NX avatar Jul 15 '20 19:07 Neuro-NX

Is it necessary? For it to work, Aegis requires Autofill Service, accessibility and 'Display over other apps' permissions. It also has to run in the background all the time (battery problems)

The app might also get bloated due to introducing this feature. Useful, but for extremely few people.

Also, the audience that uses Aegis is the kind that already uses a password manager , meaning autofill is already taken up.

vishalnandagopal avatar Jul 21 '20 07:07 vishalnandagopal

Is it necessary?

It would be the first 2FA app to support native autofill, that means combined with a password manager a user can have a fully automated authentication system. No more jumping in and out of apps.

For it to work, Aegis requires Autofill Service, accessibility and 'Display over other apps' permissions.

Autofill and accessibility service are two separate things now, the user would not need to enable accessibility (which only works in the web browser), unless they are on an older Android version. 'Display over other apps' should not be a problem, as this only activates when the app is open, when the app is fully closed the permission is deactivated. --- You can test this with '3C All in One Toolbox' and force rotation or fullscreen for a selected app, which only works when 'Display over other apps' is enabled.

It also has to run in the background all the time (battery problems)

Not necessarily, this was true for older Android versions, but Android 10 has improved battery performance for background processes.

The app might also get bloated due to introducing this feature. Useful, but for extremely few people.

Autofill is a native feature within the SDK, where would the "bloat" come from? How do you know extremely few people will use it? The whole process of 2FA has always been cumbersome, having it automatically get the token for you and insert it into the form field removes the need of having to open the app.

Also, the audience that uses Aegis is the kind that already uses a password manager , meaning autofill is already taken up.

Yes, this is correct, but I may have found a solution, which I mentioned in my previous post. The SDK enables an app to prompt the user to change the autofill app, so all you need is to find a way to get the current autofill app ID and store it in memory, change the autofill app to Aegis and then revert it back to the previous app (the user's password manager) -- with ROOT that would be easy.

Neuro-NX avatar Jul 25 '20 01:07 Neuro-NX

We currently don't have plans to implement this, because the auto fill slot is usually occupied by the password manager (as it should). Making the user switch their auto fill application constantly is not really an option. So we'll close this.

alexbakker avatar Aug 25 '21 13:08 alexbakker

Making the user switch their auto fill application constantly is not really an option.

Notice how KeePass2Android is implementing their auto fill in the screenshot(s) below. You can drag that line left and right, to see additional options.

Screenshot_20220508-215314.png

Screenshot_20220508-215232.png

Is it possible to have multiple auto fill providers, such that you could drag that line of options left & right, to access the auto fill provider you prefer to use for entry?

It would also be nice if Aegis could register itself for input fields tagged as...

<input
  type="text"
  autocomplete="one-time-code"
/>

...so it wouldn't compete with a password manager.

NumbGnat avatar May 09 '22 02:05 NumbGnat

Notice how KeePass2Android is implementing their auto fill in the screenshot(s) below

KeePass2Android actually isn't doing anything special here. This is just how autofill integration with keyboards works on Android.

Is it possible to have multiple auto fill providers, such that you could drag that line of options left & right, to access the auto fill provider you prefer to use for entry?

Not as far as I know.

alexbakker avatar May 09 '22 07:05 alexbakker