In my react native application, I'm having trouble saving login and password to a keychain. It's functional, however, it's saving the incorrect username.
Email, First Name, Last Name, Password, and Confirm Password are the text boxes in my order for the signup page.
However, I gave the email field textContentType='username' and the password field textContentType='password'. However, it uses the last name as a username by default. It seems to ignore my textContentType.
I'm aware that similar problems have been raised in the community, but I'm looking for any updates or possible solutions rather than rearranging the fields?
Keychain takes Password and input right before password, in your case is Last Name. Try to reorder the form input positions.
I created a secure area, but I am getting an error like this, what should I do?
This is not an error, this is an iCloud Keychain alert that lets users generate passwords in secure text fields. This is a useful feature for those who don't want to choose a password themselves.
More info about iCloud Keychain
I'm working with some UITextFields to use the Email field and the Password field.
In the Password field I entered isSecureTextEntry = true
In the Email field I have suggestions for the user's email
Since I entered isSecureTextEntry in the password head, the suggestions in the Email field no longer appear
Have you also had this problem? is there a way to solve it?
Thank you all
if I change isSecureTextEntry from true to false ... everything works correctly ... I don't understand
The behaviour you are seeing is by design.
Note that in the second instance iOS is showing the "Password" button to access keychain passwords.
When iOS detects a username and password field pair it offers saved usernames/passwords rather than previously used emails on the basis that this is probably more useful.
If you set the secure text field content type to "new password" then iOS will infer that this is an account creation screen and will not offer saved passwords, but in my opinion this is a worse user experience.
I implemented AutoFill for stored username and password suggestion successfully in iOS 11.
I have two text fields in my login view controller, one for email, one for password. The content types are defined as follows:
email / username text field configuration
password text field configuration
This used to work just fine in iOS 11, but after upgrading my development iPad to iOS 12, the app suggests emails for the username field and the following happens when editing the password field:
In my create account view controller, I have 3 text fields: email, password, repeat password. Their content modes are setup as follows:
email → email address
password → new password, rule: minlength:8;
repeat password → new password, rule: minlength:8;
When editing the email address field, it properly suggests an email address. For the password and repeat password fields, however, it suggests stored passwords, instead of suggesting a new password.
What I tried
(illogically) flip the content mode setup, so the login password field is set to new password and the create account password fields are set to password
no success; in fact, no change of behavior at all
set content mode to none for login and create account fields so AutoFill can try to handle it automatically
no success; in fact, no change of behavior at all
Note
AutoFill is properly setup on the server. The stored passwords being suggested in the create account fields prove that
The functionality is still working on iOS 11 iPads
When logging in with a new username, the app will ask the user to add this username and password to Keychain, even on iOS 12
Any idea what I need to change so that stored username & password suggestion works in iOS 12 again?
Thanks!
Edit
As requested by #kralex below, here's my view hierarchy for the login view controller in the storyboard:
...and on the device:
Apple is doing some heuristic to make the best guess what you might need: autofill or a new password. However in some cases it might fail.
In your case the problem is related to the "Create Account Button". It makes the system think that it is a sign up form.
The easiest option to fix it: replace sign up UIButton with UILabel and add tapRecognizer to handle taps.
I had a similar issue and found out Apple's heuristics were tapping in to the class name of the view controller to determine whether to suggest a new password or use an existing one. It seems like even if I set the correct textContentType on my UITextFields, it still would use the name of the controller.
My UIViewController has both sign up and login on the same screen, but the controller is named RegistrationViewController. I changed it to LoginViewController to test, and found that the login portion started working, but the registration bit acted like it was login! Even with the correct textContentTypes set!
I wound up having to rename my UIViewController something that doesn't imply registration or login for it to actually respect my textContentTypes. It's awful. Truly awful.
I would imagine at least part of the reason this is/was happening to you is because the you have the word Welcome as the beginning of your view controller, unbelievable as it sounds.
By the way, I tried RegistrationLoginViewController (it chose the registration setup) and LoginRegistrationViewController (it chose the login setup), and neither worked. It has to avoid Apple's heuristics if you want to have both on the same controller.
I have a web view where the user can enter their email and password. I'm wanting to know how I could save the entered values and autofill the fields when the user returns to the web view during future uses..