首页 > 其他分享 >accessDeniedHandler不生效

accessDeniedHandler不生效

时间:2022-09-29 14:35:25浏览次数:39  
标签:accessDeniedException AccessDeniedException authenticationEntryPoint 处理器 accessD

配置了异常accessDeniedHandler被全局异常捕获了不生效

        //配置异常处理器
        //认证失败处理器
        http.exceptionHandling()
                .authenticationEntryPoint(authenticationEntryPoint)
                //授权失败处理器
                .accessDeniedHandler(accessDeniedHandler);



    @ExceptionHandler(AccessDeniedException.class)
    public void accessDeniedException(AccessDeniedException accessDeniedException) throws AccessDeniedException {
        log.error(accessDeniedException.getMessage(), accessDeniedException);
        throw accessDeniedException;
    }

标签:accessDeniedException,AccessDeniedException,authenticationEntryPoint,处理器,accessD
From: https://www.cnblogs.com/Arborblog/p/16741449.html

相关文章