SpringSecurity+OAuth2认证时 /oauth/token 报错: There is no client authentication
报错:
{
"error": "unauthorized",
"error_description": "There is no client authentication. Try adding an appropriate authentication filter."
}
原因:
-
路径最后不能有斜杠 会导致request = /oauth/token/ 和 pattern='/oauth/token’匹配不上 选错了filters 错误: http://127.0.0.1:8801/oauth/token/ 正确为:http://127.0.0.1:8801/oauth/token
-
路径不能忽略
以上两种都会报:There is no client authentication. Try adding an appropriate authentication filter." 这个错