デフォルトPOST
では、SpringSecurity3.xはログインのリクエストのみを受け入れます。
postOnly
ただし、次のパラメータを使用してこの動作を制御できます。org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
(ただし、前に述べたように、のデフォルトpostOnly
はtrueです)
しかし、おそらく主な問題は、実際のSpring Security 3.xではなく、古いSpringacegiセキュリティを使用していることです。上記のステートメントが私の真実ではないよりも、これが事実です。だから私は更新することを強くお勧めします!
SpringACEGI1.0.xの場合
次のようなものattemptAuthentication
でメソッドをオーバーライドしてみてください。AuthenticationProcessingFilter
if (request.getMethod().equals("POST"))
return super.attemptAuthentication(request);
else
throw new AuthenticationServiceException("service accept only http post");
コメントを参照してください:onPreAuthentication()
継ぎ目をオーバーライドすることも良い方法です