Spring Security, OpenId and special characters

I wanted to enable open id login with spring security 3.0.7. I’ve used google as a open id provider.
Setup was pretty easy, everything by the book. I’ve tried with couple of accounts and everything was ok.

But when I tried to use my “official” google account, I’ve ran into a problem. My account couldn’t pass the verification. In log files I’ve found this:

Verification failed for: [http://somedomain] reason: null

Reason null. Whoa, too much information :)

Googling didn’t help much, until I’ve realized that the problem was in encoding. Yup, all accounts worked except mine… and I have the letter ć in my surname. I guess the same problem would be with umlauts and similar.

The easiest fix was to add just one attribute to the Connector element in server.xml tomcat configuration. The magical attribute is:

URIEncoding="UTF-8"


Leave a comment