My Vaadin Login Page doesnt trigger Chromes "Save Password" function

Sebastian G. :

I am currently working on a website written with Vaadin and Spring Security.

When you login to a webpage, e.g. Mail Clients etc you get the "Do you want to save your password" prompt. In my case this is not happening.

I have created a vaadin application which doesnt trigger this.

I do have a form with action and method and also have named my inputs correctly.

I tried enabling autocomplete and autocorrect=off but it doesnt seem to work. Any reason why this doesnt get triggered?

Additional information:

Vaadin Version: 14.1.17 Spring Boot: Latest Version

URL to test: https://rp.mainlevel.at

Code:

username = new TextField();
username.getElement().setAttribute("name", "username");
username.setAutocomplete(Autocomplete.USERNAME);
username.setAutocorrect(false);
username.setPlaceholder(getTranslation("login.username", langLocale));
username.addClassName(AdminPress.FORM_CONTROL);

pwfield = new PasswordField();
pwfield.getElement().setAttribute("name", "password");
pwfield.getElement().setAttribute("id", "password");
pwfield.setAutocomplete(Autocomplete.CURRENT_PASSWORD);
pwfield.setAutocorrect(false);
pwfield.setPlaceholder(getTranslation("login.placeholder.password", langLocale));
pwfield.addClassName(AdminPress.FORM_CONTROL);
Tatu Lund :

The input element in the TextField and PasswordField are hidden inside these web-components shadow DOM, hence Chrome is not detecting the native input normally and this autocomplete does not happen. There is also feature request about this in Chrome

There is a Login form component in the framework which should work with with password managers. On Vaadin web site there is also a detailed tutorial how to use it with Spring Security as well.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=12564&siteId=1