Detect generated automatic strong password in UITextField

Originator:jeff
Number:rdar://43569820 Date Originated:August 21 2018, 2:28 PM
Status: Resolved:
Product:iOS + SDK Product Version:
Classification: Reproducible:
 
Area:
UIKit

TL;DR - It would be nice if there were some way for our app to definitively detect when an automatic strong password has been generated and autofilled into a UITextField.

iOS 12 adds support for automatically generating strong passwords, and it's really easy to use, which is great.

Our app currently displays a password strength meter next to the password text field on our signup screen. Since the automatic strong passwords feature has its own UI (turning the text field background yellow, adding the phrase "Strong Password", and partially obscuring the password), I would like to hide our own password meter when automatic strong passwords are used. Other apps may wish to hide a "reveal password" UI button next to the password text field when an automatic strong password is filled.

However, there does not appear to be any way to definitively detect when a user has generated an automatic strong password that has been filled in a UITextField, so our app now shows the system automatic strong password UI next to our own password strength meter, which seems redundant and possibly confusing to the user.

We could work around this by monitoring the UITextField using `UITextFieldTextDidChangeNotification` and/or `textField:shouldChangeCharactersInRange:replacementString:` to see if the UITextField.text matches the known generated password format `^\\w{6}-\\w{6}-\\w{6}$`, but this is brittle, can produce inaccurate results if the user happens to type a password matching the generated password format, and likely will not work with 3rd party password managers using the new iOS 12 integration since they will likely use their own generated password format.

In summary, it would be nice if there were some way for our app to definitively detect when an automatic strong password has been generated and autofilled into a UITextField.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!