请求报错

Blade 未结 1 1742
394505099
394505099 剑童 2019-12-02 19:38

一、该问题的重现步骤是什么?

1. 

error_description contains invalid ASCII characters, it must conform to RFC 6749

2. 

只要是抛出异常 , 用中文提示: 如 

throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND);
//  TokenUtil.USER_NOT_FOUND = "用户名或密码错误"

就会走到 OAuth2Exception里边 ,
然后
private static String assertErrorDescription(String description) {
   if () {
      throw new IllegalArgumentException("error_description contains invalid ASCII characters, it must conform to RFC 6749");
   }
   return description;
}
private static boolean (String description) {
   if (description == null) {
      return true;
   }
   for (char c : description.toCharArray()) {
      if (withinTheRangeOf(c, 0x20, 0x21) ||
            withinTheRangeOf(c, 0x23, 0x5B) ||
            withinTheRangeOf(c, 0x5D, 0x7E)) {
         return true;
      }
   }
   return false;
}
, 中文都不在那个范围里边, 接着抛出其他异常 , 前端就收不到 "用户名或密码错误" 了.

3.


二、你期待的结果是什么?实际看到的又是什么?



三、你正在使用的是什么产品,什么版本?在什么操作系统上?



四、请提供详细的错误堆栈信息,这很重要。



五、若有更多详细信息,请在下面提供。



1条回答
  • 2019-12-05 16:49

    这是oauth2依赖版本的问题,回退到正常的版本就可以了

    image.png

    0 讨论(0)
提交回复