Encode username for authentication

Add html encoding to fix login error for usernames with special
characters