Angular 5 Oauth2.0基本auth POST请求返回401(未授权)

时间:2018-05-08 07:16:30

标签: angular oauth-2.0 spring-security-oauth2

我想使用帖子请求获取访问令牌。

任何人都可以帮助我为什么会这样?

let _httpParams = new HttpParams()
.set("username","username")
.set("password","password")
.set("grant_type","password")

let _httpHeader = new HttpHeaders();
_httpHeader = _httpHeader.append("Content-Type", "application/x-www-form-urlencoded");
_httpHeader = _httpHeader.append("Authorization", "Basic " + btoa("username:password"));

return this._http.post(API_URL+'/oauth/token',{headers: _httpHeader,params: _httpParams})

我总是得到这个结果

enter image description here

0 个答案:

没有答案