0
這是我的代碼:Azure中獲取令牌使用JavaScript角
$scope.getToken = function() {
// $scope.connect()
$http(
{
method: 'POST',
url: $scope.urlToGetToken,
params: $scope.authParams,
headers: {"Content-Type": 'application/x-www-form-urlencoded'}
}
).
success(function(data){
console.log("whatever" + data);
}).
error(function(data, status, headers, config){
console.log(data);
console.log(headers);
console.log(config);
})
$scope.authParams = {
grant_type: 'authorization_code',
client_id: '03b****************ba-931c-3b19f204c736',
code: 'AAABAAAAv*********b',
redirect_uri: 'localhost:8080'
}
儘管grant_type
參數是有我得到400
,出現以下錯誤:
"AADSTS90014: The request body must contain the following parameter:
'grant_type'. ↵Trace ID:
這是怎麼回事?