我提到了这个链接
Visit: http://www.elylucas.net/post/authenticating-with-sharepoint-online-in-a-ionicangularphonegap-app/ Authenticate Sharepoint API
从上面的链接我使用此功能并获得安全令牌成功但我无法获得Set-Cookie
标头响应我必须将此cookie发送到每个sharepoint api请求以获得api响应成功但我正在努力解决这个问题。
请帮帮我。
function getBearerToken(result, url) {
var deferred = $q.defer();
var securityToken = $($.parseXML(result)).find("BinarySecurityToken").text();
if (securityToken.length == 0) {
deferred.reject();
}
else {
$http({
method: 'POST',
url: url,
data: securityToken,
headers: {
Accept: "application/json;odata=verbose"
}
}).success(function (data) {
deferred.resolve(data);
}).error(function () {
deferred.reject();
});
}
return deferred.promise;
}
});