0
以下のコードは機能しません。許可タイプは "client_credentials"です。ステータス-1のヌル応答を返します。 APIは大丈夫です。両方のリクエストは郵便配達員で問題なく機能します矩形 - 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' });
}
以下のコードは「パスワード」認可タイプで完全に機能します。
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