Getting iOS password AutoFill to work with a "change password" page
Asked Answered
M

1

9

I've gotten iOS password autofill to work with "login" and "new account" pages but not a "change password" page. I have 4 UITextFields on that page. 1 with .email as the content type, 1 with .password as the content type for the original password, and 2 with .newPassword as the content type for the new password.

The autofill tries to fill in the .password and first .newPassword fields with a new generated password and the last field is blank. I've tried switching the order but then the password doesn't get updated in keychain.

I tried only having the 2 .newPassword fields but it still doesn't update they keychain.

Does anyone know how to get it to work or if there is a tutorial on a best practice for "change password" screens? Apples documentation only covers login and new account.

thanks.

Metalanguage answered 18/9, 2018 at 15:14 Comment(2)
Entirely unrelated, how did you get the .newPassword and autofill to work?Robledo
Hey, I'm facing exactly the same issue... Did you manage to solve it?Vilhelmina
F
8

I experience the same problem: AutoFill fills old password and new password field with the same generated password.

I solved this by moving the old password field up above the username.

  • Current password (content type: password)
  • Username (content type: username) (in my case this is a non editable pre-filled text field)
  • New password (content type: newPassword)

It's a bit strange but after the view controller dismisses the keychain password is updated immediately without confirmation.

Fruiter answered 19/10, 2018 at 10:8 Comment(3)
This only sort of works for me. It give me the correct field filling behavior (mostly; sometimes it doesn't draw the strong password in the new password fields), but it's not reliable about saving the changed password to the keychain. It seems like I need to fill in the current password before autofilling the new password. If I autofill the new password, then fill in the current password it doesn't save the new password to the keychain.Ruberta
To get it to ask to save, the new password field has to be the last focused field, so I keep track of what the last focused field is, and then if it's not the new password field I focus it before the sheet is dismissed.Multure
Although in the end I think I'm just going to use SecAddSharedWebCredentialMulture

© 2022 - 2024 — McMap. All rights reserved.