LoginContext.SecureCallbackHandler not UTF-8 friendly
I am using JAAS with JDK 1.4
In my login page, if I enter a user name in East Asian characters, or other non-regular letters, like ? and when I debug my code:
Callback[] callbacks = new Callback[] { new NameCallback("Username: "), new PasswordCallback("Password: ", false) };
callbackHandler.handle(callbacks);
username = ((NameCallback) callbacks[0]).getName();
I would see that the username variable here contains screwed characters. And the callbackHandler is an instance of javax.security.auth.login.LoginContext.SecureCallbackHandler.
I heard a workaround to get the bytes from the screwed username above, and use those bytes to reconstruct a string UTF-8 encoded. But I am afraid that in the future if this issue is fixed by javax..., I would double encode it.
Any suggestions/ideas?
Thanks!

