Supporting LastPass and other password managers

Currently when trying to use a password manager such as LastPass with my ionic app login interface, it is using “localhost” as the domain for remembering my credentials for the app - which makes sense, since the webview is serving the site from localhost. However, since the password manager uses the domain to suggest the propert credentials, instead of suggesting just the credentials for my app I am seeing tons of credentials which are all associated with localhost.

Is there any way to improve this experience so that the LastPass will recognize the app, rather than the URL?

Also - after signing in the first time, LastPass (on Android) does not offer to remember the credentials. Is there a way to enable this so that LastPass will offer this, like it does on other mobile apps?

Thanks,

Bob

5 Likes

You need to setup associated domain (webcredentials) Apple Developer Documentation, but even with that it will not stop using localhost when you app the app, but it will suggest you password entries in the app at least.

I got exactly that right now! I have the google password manager working on Android and it saves the passwords under ‘localhost’ even though I have everything configured to associate my Android app with the website. And on iOS it’s even worse; I can open keychain, but it shows me all my passwords, so nothing related to the current domain. Even though I have everything configured there as well. Deep links do seem to work on both platforms however.

Any updates / new solutions for this?

2 Likes

go to capacitor.config.json.

add this section

 server: {
    "iosScheme": "https",
    "androidScheme": "https",
    "hostname": "example.com",
    "allowNavigation": ["*.example.com"]
  }

the hostname is important here.