Repository navigation
Password field empty after failed login #40525
|
Hi, I have a question regarding the login behavior in Keycloak. Currently, when I submit an incorrect password, the username field remains filled while the password field is cleared. Is it possible to configure Keycloak so that the password field retains the entered value after a failed login attempt, to allow users to easily spot and correct typos? Wouldn't this be better UX? Is there a technical reason? Additionally, is it possible to configure Keycloak to automatically clear the password field after a period of inactivity ? For example, in cases where a user walks away from the computer without logging in? This could help mitigate the risk of unauthorized access? Thanks in advance for your help! |
Replies: 1 comment
|
I don't think it would be that hard to keep the password field as-is after a failed login, but I think it may not be a good idea, as correcting the password would most likely require the user to use the reveal button. As you've already spotted in the last question, the user may be in a place with other people and encouraging them to reveal the plain-text version of the password to fix typos would be detrimental, as it could allow someone to take a picture of their screen. About the clearing the password field, it should be doable using a timeout callback that clears it, or simply adding something like a meta attribute to the page (although it could be confusing for users since it does not really account for activity). |
I don't think it would be that hard to keep the password field as-is after a failed login, but I think it may not be a good idea, as correcting the password would most likely require the user to use the reveal button. As you've already spotted in the last question, the user may be in a place with other people and encouraging them to reveal the plain-text version of the password to fix typos would be detrimental, as it could allow someone to take a picture of their screen.
About the clearing the password field, it should be doable using a timeout callback that clears it, or simply adding something like a meta attribute to the page (although it could be confusing for users since it does not…