Open xsolon opened 4 years ago
Could you help with this? Doesn't seem to work for asmx services. I'm getting a 401 error
` spauth.getAuth(siteUrl, settings) .then(options => {
let headers = options.headers; headers['Content-Type'] = 'text/xml'; headers['SOAPAction'] = 'http://schemas.microsoft.com/sharepoint/soap/GetSite'; var data = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetSite xmlns="http://schemas.microsoft.com/sharepoint/soap/" /></soap:Body></soap:Envelope>'; request.post(siteUrl + '/_vti_bin/SiteData.asmx', { body: data, headers: headers }).then(response => { debugger; //process data }); });`
Which kind of auth do you use?
Cloud AppOnly credentials
App-only creds don't work with asmx services. You could try user\password auth instead.
Could you help with this? Doesn't seem to work for asmx services. I'm getting a 401 error
` spauth.getAuth(siteUrl, settings) .then(options => {