If the authn/Password login flow's login page (views/login.vm) is re-displayed after authentication errors (e.g. wrong password), the username field is filled in with the transformed username, in case transformations are enabled (e.g. transforming to lower case, applying regular expression replacements etc.). This might confuse users. Instead, the initially entered username should be filled in.
- User enters "MyUsername" as username
- Transformations transform the username to "myusername"
- An authentication error occurs.
- The login form is displayed again.
- The username field is filled in with the transformed username, e.g. "myusername".
- A user might expect "MyUsername".
Currently, the value stored in UsernamePasswordContext.username is filled in, which is the transformed username. It seems that the initially entered username is not preserved. I propose that the initially entered username is stored in UsernamePasswordContext and used while re-displaying the login page. Possibly, this behavior could be made configurable.