0
私はDrupalからAngularを前面に使用してアクセストークンを受け取ろうとしています。エラー:「invalid_grant」角度5
ngOnInit() {
this.testAuthSite()
.subscribe(
data => { console.log(data); },
error => { console.log(error); }
);
}
// Multiple - Returns the list of all companies available for this user
testAuthSite() {
const body = {
grant_type: 'password',
client_id : '61705f72-xxx-xxx-xx',
client_secret: 'admin',
username: 'angular',
password: 'admin',
scope: null
};
const options: any = {
headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
};
return this.http.post(ApiURI, body, options);
}
私は郵便配達してみました、それが動作します。
私はscope
キーの""
とnull
の両方を試してみました。どちらも動作しません。
私はこのエラーを取得しています:
error:
error:"invalid_grant"
hint:"Check the configuration to see if the grant is enabled."
message:"The provided authorization grant (e.g., authorization code,
resource owner credentials) or refresh token is invalid, expired, revoked,
does not match the redirection URI used in the authorization request, or
was issued to another client."
__proto__:Object
headers:HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
message:"Http failure response for http://ecd2-
oes.dev.ee.citeoeo.com/oauth/token: 400 Bad Request"
name:"HttpErrorResponse"
ok:false
status:400
statusText:"Bad Request"
url:"http://xxxx.com/oauth/token"
そして、ここでは、私が送信してるかの詳細です:
はあなたの助けをありがとう!