Spring Cloud OAuth2中访问/oauth/token报401 Unauthorized问题的解决
Spring Cloud OAuth2中访问/oauth/token报401 Unauthorized问题的解决问题分析问题解决问题分析在新建的Spring Cloud OAuth2项目中使用grant_type为password方式访问时报server_error。在postman中如下:{"timestamp": "2021-01-16T10:26:53.052+00:00","status"
·
问题分析
在新建的Spring Cloud OAuth2项目中使用grant_type为password方式访问时报server_error。在postman中如下:
{
"timestamp": "2021-01-16T10:26:53.052+00:00",
"status": 401,
"error": "Unauthorized",
"message": "",
"path": "/oauth/token"
}
如下图:
网上部分用户说使用grant_type=password获取access_token时可以不指定client_id和client_secret,就会报这个错误,消除这个错误的方式,就是不论grant_type的值是什么都需要在参数中指定client_id和client_secret
问题解决
在请求参数中加上client_id和client_secret,如下:
更多推荐
已为社区贡献16条内容
所有评论(0)