Why does iOS Password Autofill not prompt to save password on keychain?
Asked Answered
H

4

9

I am setting up iOS Autofill Password in my app, and I followed all the guidelines in this tutorial https://medium.com/developerinsider/ios12-password-autofill-automatic-strong-password-and-security-code-autofill-6e7db8da1810. If I have a manually saved password in the keychain for the app's website, it gives me the option to autofill it on login. However, when the credentials are not saved, the app does not prompt me to save them on login.

My username and password textfields are with correct content types (just like in your tutorial), I have the apple-app-site-association file configured properly, and the associated domains as well.

I don't understand what I am missing.

Halfsole answered 18/6, 2019 at 22:23 Comment(0)
P
6

You didn't put any log about that. But the AutoFill feature has some tricks that need attention as describe on Robots & Pencils and other question in stack overflow

One attention point if you update the apple-app-site-association remove the app from your device and install again because the app store the last version as a cache.

Verify the TEAM ID on apps in apple-app-site-association because many get confused with the signing id from your account.

Known issue:

[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: app.bundle.id due to error: iCloud Keychain is disabled

Do you need check on your macOS on Internet Account -> iCloud -> Keychain is enabled and verify in your idevice if the feature is enabled on Settings -> Apple ID -> iCloud -> Keychain is On

In the other case if you followed the tutorial correctly it will be working

Pistole answered 21/6, 2019 at 22:4 Comment(1)
Hi, thanks for all the good suggestions, but none of this helps. I am certain that the TEAM ID is correct, all the keychain settings are enabled, I don't get anything in the log for Autofill. Tried deleting the app and still nothing. Thanks again for your help.Halfsole
C
3

I had the same problem. In my case the issue was that I was clearing the username and password text fields after successful authentication before pushing my next view. Apple's heuristics seem to require the text fields with .username and .password content types to be populated when the view disappears.

Cuprite answered 28/4, 2022 at 15:1 Comment(1)
Thank you. Thanks to this answer, I discovered that I don't need to use SecAddSharedWebCredential. My view (with register textfields) was not being removed after registration from the view hierarchy stack and therefore the system was not asking if user want to save credentials. After removing the view and view controller correctly, everything started working. I also removed the .login type from register view textfield type and keep the fields and button in one StackView. All this made it work in my application.Eggbeater
H
2

I was having same problem. I did all the setup which recommended by Apple (https://developer.apple.com/documentation/security/password_autofill/about_the_password_autofill_workflow).I had few fields in between UserName and Password field on Signup Screen. But when I put Password field just next to UserName field then Apple popup to save password appearing.

Hoarse answered 7/12, 2020 at 1:56 Comment(0)
H
0

I have the same problem, Because 3 textField in my viewController, usernameTextField,passwordTextField and authcodeTextField.Set passWordTextField.becomeFirstResponder() before release the controller, its work for me

Headon answered 14/9, 2020 at 8:27 Comment(1)
Could you please edit your answer to make it clearer?Zaporozhye

© 2022 - 2024 — McMap. All rights reserved.