Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login doesn't support UTF-8 #7

Closed
ViktorK69 opened this issue May 27, 2016 · 2 comments
Closed

Login doesn't support UTF-8 #7

ViktorK69 opened this issue May 27, 2016 · 2 comments

Comments

@ViktorK69
Copy link

ViktorK69 commented May 27, 2016

Hi!
I faced the following issue using spring-lemon's authentication module. I've overriden the user model object and I added a 'username' column to it, and I use this as username at login.
When I add a user with special character (like ő or ű, these are often used characters in Hungarian), the authentication fails with the following response:
{"timestamp":1464383714327,"status":500,"error":"Internal Server Error","exception":"java.io.CharConversionException"
,"message":"Not an ISO 8859-1 character: ő","path":"/userCrudBoot2/login"}

However, I can save or retrieve data with these characters without any problem, the request with the url "/api/core/context" comes back with a perfect response (the characters are all correct), only the login cannot handle them. Also, some of the characters in the response of the login don't cause the error mentioned above, but in the response I see diamond characters with question mark (characters like 'ö' or 'ü'). Again, requesting the context it gives them back all correct.

I tried to override the AuthenticationSuccessHandler, and I replaced this line:
"response.setContentType(MediaType.APPLICATION_JSON_VALUE);" whit this:
"response.setContentType("application/json;charset=UTF-8");"
but it didn't help.

Also, the authentication doesn't make difference - for example- between "admin" and "ádmin", what can be a problem in Hungarian.

What can be the problem?
Thank you in advance!

@naturalprogrammer
Copy link
Owner

Seems to me like some Spring Security related problem. Did you try googling? For example, I found this stackoverflow post, which seems worth trying out -> http://stackoverflow.com/questions/9772429/spring-security-utf-8-codpage-with-russian-usernames.

@naturalprogrammer
Copy link
Owner

Not related to Spring Lemon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants