AutoPassword-iOS12-Demo icon indicating copy to clipboard operation
AutoPassword-iOS12-Demo copied to clipboard

How to enable auto-fill for 2 page login ?

Open skadambala opened this issue 6 years ago • 9 comments

Hi @vineetchoudhary

Thanks for putting up this article. It's very elaborative and easy to understand. I gave a try using your source. Auto fill password is working fine.

I have question for you. Does auto fill password support on 2 page login ? First screen having username textfield and second screen having password textfield. I have tried but no luck. Do you have any inputs for me to make it work on 2 page login ?

Thanks, Swathi

skadambala avatar Jul 24 '19 06:07 skadambala

Hi,

I think it is possible but I'm not sure. You can try it by putting a hidden username textfield on 2nd page. Where username will be prefilled which you can do just passing the username from 1st page. Also, don't forget to set textContentType for both field.

Let me know if it's work. 😃

vineetchoudhary avatar Jul 24 '19 08:07 vineetchoudhary

Yeah, that's what I have thought of doing so if there is no straight forward way of doing it. Before going with that approach, I wanted to know from you if you have done some thing like that.

skadambala avatar Jul 24 '19 08:07 skadambala

There is no official documentation for this case. So, go ahead with above approach and let me know about the final result. 😛

vineetchoudhary avatar Jul 24 '19 12:07 vineetchoudhary

iOS displays 'Do you want to save password' dialog only when user selects input fields (set with right content types). In my case, as second field is hidden, I tried first bysimulating fake tap on hidden text field and even with making hidden textfield as first responder, and also tried by firing some events on textfield. None of these are working :(

skadambala avatar Jul 24 '19 13:07 skadambala

I came across this. https://developer.apple.com/documentation/security/password_autofill/enabling_password_autofill_on_a_text_input_view

Did u see this "Explicitly defining a view’s text content type improves the performance of Password AutoFill’s heuristics and lets you support login workflows that couldn’t otherwise be detected by these heuristics. For example, the heuristics assume the user name and password inputs are on the same page. If you have a multipage login form, explicitly setting the .username and .password types lets the user tap and fill those inputs, even if they are on separate pages"

I am going to change textfields to textviews and try it out.

skadambala avatar Jul 25 '19 03:07 skadambala

iOS displays 'Do you want to save password' dialog only when user selects input fields (set with right content types). In my case, as second field is hidden, I tried first bysimulating fake tap on hidden text field and even with making hidden textfield as first responder, and also tried by firing some events on textfield. None of these are working :(

As you say the second text field is hidden. I think you should try by putting the username field first (before the password field).

vineetchoudhary avatar Jul 25 '19 05:07 vineetchoudhary

This above solution for the auto-fill password doesn't work for me. Does any other way to achieve it?

mahesh-rideziro avatar Aug 08 '20 19:08 mahesh-rideziro

If you have a multipage login form, explicitly setting the .username and .password types lets the user tap and fill those inputs, even if they are on separate pages.

How to implement this for autofill password for multipage login form?

mahesh-rideziro avatar Aug 10 '20 12:08 mahesh-rideziro

Hi any one could get autofill for multipage login. I tried hiding username textfield but no luck.I don't understand the statement in Apple documentation

"Explicitly defining a view’s text content type improves the performance of Password AutoFill’s heuristics and lets you support login workflows that couldn’t otherwise be detected by these heuristics. For example, the heuristics assume the user name and password inputs are on the same page. If you have a multipage login form, explicitly setting the .username and .password types lets the user tap and fill those inputs, even if they are on separate pages"

I have set them but no luck

SyamalaHari avatar May 14 '24 20:05 SyamalaHari