Hey Sylviann,
Do this.
The example scenario is - User enters the username and leaves the password field blank. On submit button, the login form is re-shown to the user and the username is pre-populated in the form
- Inside the script (in the authenticate method) you will have something like this
```
if password is None:
identity.setWorkingParameter("username",user_name)
```
- Inside login.xhtml, In window.onload() method do this:
```
var retainedUserName = #{identity.sessionId.sessionAttributes['username']};
document.getElementById("loginForm:username").value = retainedUserName;
```
I hope this helps.
Have a good day!