iOS 11 password autofill doesn't save password to the Keychain
Asked Answered
D

1

8

I'm using Password Autofill feature in the iOS app.

I've set the needed textContentType properties to username and password respectively. Also, I've enabled iCloud Keychain in the iOS settings.

The bar appears, I'm able to fill in the login form with the credentials from other apps. However, I'm unable to save the credentials I enter.

Is it possible to Save credentials to the keychain without associating the app with the website, like shown in the WWDC session?

Detinue answered 26/3, 2018 at 13:3 Comment(0)
D
9

No, It's not possible to add credentials to ICloud Keychain without associating a domain to it. Apple needs it to identify and suggest the credentials based on that registered domain.

looks like this feature existed since IOS 8, In IOS 11 they just updated it to make it easier by adding textContentType in uitextinputtraits and automating the process a bit.

You can manage Icloud Keychain Credentials Using Security.SecSharedCredentials Apis

SecAddSharedWebCredential - you can provide your domain(yourwebsite.com), userName, and Password as params to be saved in ICloud Keychain. from the looks of it will show an alertView for confirmation to save/update. enter image description here

Demonstrate answered 29/3, 2018 at 13:34 Comment(5)
Still, it requires a website association. It seems, that this API is about sharing credentials with the website in the first place. My idea was to simply remember users' credentials for the app in the keychainDetinue
so your app doesn't have a website, is that what you mean? because keychain definitely needs some fqdn(fully qualified domain name) to save the credentials under it.Demonstrate
Yes, I see, so the answer to the question is that it's impossible to have such a configuration. The app needs to have a corresponding website.Detinue
yes, you definitely need the domain, my bad I actually misunderstood your question as "without login in the website (logging in safari first)". I updated the answer please have a look.Demonstrate
Thanks for the help!Detinue

© 2022 - 2024 — McMap. All rights reserved.