OAuth2用密码模式授权返回错误信息为Full authentication is required to access this resource

Blade 已结 2 11647
风缘
风缘 2019-04-24 14:15
悬赏:3

操作步骤:image.png所有服务都已经启动,按照开发手册里面的方式使用密码模式授权image.png

设置headers里的内容

image.png

设置body里面的内容

提交返回

image.png

2条回答
  •  zhaixiaobin
    zhaixiaobin (楼主)
    2020-07-03 14:32

    image.png




    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 项目中去。 

           

                org.springblade

                blade-core-secure

           


代码语言
提交回复