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.

MJLyco
  • 274
  • 3
  • 4

1 Answers1

7

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.

shim
  • 9,289
  • 12
  • 69
  • 108
cornr
  • 653
  • 4
  • 20
  • 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. – Greg Apr 06 '21 at 18:07