0
以下代碼無效。授予類型是「client_credentials」。它返回狀態爲-1的空響應。 API是好的。這兩個請求都可以在郵遞員上正常工作Restangular - 不支持Client_credentials授權類型?
function authentication(user) {
return Restangular
.all('token')
.post('grant_type=client_credentials&client_id=' + APPLICATION.clientId + '&client_secret=' + 'XYZ',
undefined, { 'Content-Type': 'application/x-www-form-urlencoded' });
}
以下代碼與「password」授權類型完美配合。
function authentication(user) {
return Restangular
.all('token')
.post('grant_type=password&username=' + user.username + '&password=' + user.password + '&client_id=' + APPLICATION.clientId,
undefined, { 'Content-Type': 'application/x-www-form-urlencoded' });
}
出了什麼問題?
這些只是例子。這兩項要求對郵遞員都適用。 – thiago