AuthenticationEntryPoint

AuthenticationEntryPoint

基本上,即时通讯基于此错误:

Caused by: java.lang.IllegalStateException: Cannot convert value of type [example.TestAuthFilterEntryPoint] to required type [org.springframework.security.web.AuthenticationEntryPoint] for property 'authenticationEntryPoint': no matching editors or conversion strategy found
... 42 more

基本上我只是将此类实现为AuthenticationEntryPoint
import org.springframework.security.ui.AuthenticationEntryPoint;
import org.springframework.security.AuthenticationException;
public class TestAuthFilterEntryPoint implements AuthenticationEntryPoint,
    InitializingBean {...

我是否在正确“转换”此方面缺少某些东西?

最佳答案

您应该实现的接口(interface)在Spring Security> = 3.0中的org.springframework.security.web包中(就像您在错误消息中一样),因此应该是:

import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.AuthenticationException;
public class TestAuthFilterEntryPoint implements AuthenticationEntryPoint,
    InitializingBean {
  // ...

09-09 17:55