У меня есть приложение весной/весной-mvc, которое полностью использует JSON-связь. Теперь мне нужно аутентифицировать мое приложение с помощью Spring Security 3 (который использует LdapAuthenticationProvider) через JSON.
Форма отправки Spring Spring по умолчанию требует POST:
POST /myapp/j_spring_security_check HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 32
Host: 127.0.0.1:8080
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
j_username=myUsername&j_password=myPass
Но я хочу передать объект JSON следующим образом:
{"j_username":"myUsername","j_password":"myPass"}
Я прочитал много сообщений вроде этого, этого другого или этого без везения, во всех случаях ajax делается POST, как указано выше.
Есть идеи?