1.Authorization的值设置成 Basic c3dvcmQ6c3dvcmRfc2VjcmV0
2.查看gateway、auth、user、system控制台是否有错误信息
3.检查下redis链接是否都连接成功,并且执行flushdb命令
4.前往blade-user服务的UserServiceImpl的userInfo方法,进行断点调试查看是否报错
5.前往blade-auth服务的BladeUserDetailsServiceImpl方法,进行断点调试查看是否报错
handleSpringSecurityException(HttpServletRequest requestHttpServletResponse responseFilterChain chainRuntimeException exception) IOExceptionServletException { (exception AuthenticationException) { .logger.debug(exception).sendStartAuthentication(requestresponsechain(AuthenticationException)exception)} (exception AccessDeniedException) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication()(!.authenticationTrustResolver.isAnonymous(authentication) && !.authenticationTrustResolver.isRememberMe(authentication)) { .logger.debug(exception).accessDeniedHandler.handle(requestresponse(AccessDeniedException)exception)} { .logger.debug(+ (.authenticationTrustResolver.isAnonymous(authentication) ? : ) + exception).sendStartAuthentication(requestresponsechainInsufficientAuthenticationException(.messages.getMessage()))} } }
此问题的代码报错位置。
最后的解决方案(版本: 2.4.0.RELEASE):
这个依赖, 不可以加到blade-oauth 项目中去。
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-secure</artifactId>
</dependency>
扫一扫访问 Blade技术社区 移动端