AuthenticationSuccessEvent 后的 AccessDeniedException

问题描述

我有一个 Spring Boot 库,它实现了 HTTP 身份验证

@Component
public class AuthenticationSuccessListener implements ApplicationListener<AuthenticationSuccessEvent> {

    @Override
    public void onApplicationEvent(AuthenticationSuccessEvent event) {
        // this gets called
    }
}

@Component
public class CustomAccessDeniedHandler implements AccessDeniedHandler
{
    @Override
    public void handle
    (
        HttpServletRequest    request,HttpServletResponse   response,AccessDeniedException exception
    )
    throws IOException,servletexception
    {
        // this also gets called
    }
}

身份验证成功,但访问被拒绝。日志中没有其他线索。

身份验证和授予/拒绝访问权限之间会发生什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)