The key is the login, not the username, is that the issue ?
Then you could pass the login as argument, instead of the username
(sorry I don't have the code in my IDE at the moment)