Authentication string truncated and causing error Code 400

Nov 19, 2013 at 4:47 PM
Edited Nov 19, 2013 at 4:58 PM
Hi, I really love your jQuery library and I have been using it without any problem with SharePoint 2007. Recently my company upgraded to SharePoint 2010 and I am noticing random errors with the SOAP query. The same code would sometimes return good response and sometimes result in error. This is driving me crazy.

I compared the SOAP request that returned a successful response with the SOAP request that returned error and the only difference that I see is with the Authorization: string in the request.

I am using Chrome Developer view to capture the SOAP message. Note that If I simply replay the XHR request, it sometimes sends a longer Authorization string in the SOAP request and it returns a valid response..

I am using the new promise way of doing the query and I am executing query on 7 lists. Sometimes, all 7 works. Sometimes, 6 of them will work and 1 would result in an error. And i see that the "Authorization:" string in the SOAP request for the failed query is different from the successful ones.

What I wanted to know is: How is the authorization string calculated and do you know why it would get corrupted/truncated at random?

e.g. The failed request looks like this:
Request URL:http:/xxxxxxxxxxxxxxxxxxxxxx/_vti_bin/Lists.asmx
Request Method:POST
Status Code:400 badrequest
Request Headersview source
Accept:application/xml, text/xml, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Authorization:NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==
Content-Length:736
Content-Type:text/xml;charset='UTF-8'
Cookie:__utma=240286337.1783481512.1372325602.1376989320.1384754503.3; __utmz=240286337.1372325602.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://sabre.com/
Host:xxxxxxxxxxxxxx.com
Origin:http://xxxxxxxxxxxx.com
Proxy-Connection:keep-alive
Referer:http://xxxxxxxxxxxxxxxxxxxxxxxxxx.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
X-Requested-With:XMLHttpRequest
Request Payload
<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><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'><listName>HolderDatabaseError</listName><viewName></viewName><query><Query> <Where><Eq><FieldRef Name="LinkedProblemId" /><Value Type="Number">17</Value></Eq> </Where></Query></query><viewFields><ViewFields><FieldRef Name='ID' /><FieldRef Name='LinkedProblemId' /><FieldRef Name='File' /><FieldRef Name='Record' /><FieldRef Name='Field' /></ViewFields></viewFields><rowLimit>0</rowLimit><queryOptions><QueryOptions></QueryOptions></queryOptions></GetListItems></soap:Body></soap:Envelope>
Response Headersview source
Cache-Control:no-cache
Connection:Close
Content-Length:899
Content-Type:text/html
Via:1.0 xxx.xxx.220.28 (McAfee Web Gateway 7.3.2.3.0.16052)
The successful request looks like this:
Request URL:http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/_vti_bin/Lists.asmx
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:application/xml, text/xml, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Authorization:NTLM TlRMTVNTUAADAAAAGAAYAJIAAAAYABgAqgAAAAwADABYAAAAEgASAGQAAAAcABwAdgAAAAAAAADCAAAABYKIogYBsR0AAAAPayzKAcJ2s/IonFO5smPa3kcATABPAEIAQQBMAFMARwAwADIAMQAzADEAOQAwAEgAOAA0ADYAMAAzADAANQAzADMAMQAxxxxxxxxxxxxxxxxAAAAAAAAAAAAAAAAAAAAC40J9yjygdazHZxxxxxxxxxxxxxxxxxxxxxxxx=
Content-Length:736
Content-Type:text/xml;charset='UTF-8'
Cookie:__utma=240286337.1783481512.1372325602.1376989320.1384754503.3; __utmz=240286337.1372325602.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://xxxxxxxxxxx
Host:xxxxxxxxxxxxx
Origin:xxxxxxxxxxx.com
Proxy-Connection:keep-alive
Referer:http://xxxxxxxxxxxxxxxxxx.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
X-Requested-With:XMLHttpRequest
Request Payload
<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><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'><listName>HolderDatabaseError</listName><viewName></viewName><query><Query> <Where><Eq><FieldRef Name="LinkedProblemId" /><Value Type="Number">17</Value></Eq> </Where></Query></query><viewFields><ViewFields><FieldRef Name='ID' /><FieldRef Name='LinkedProblemId' /><FieldRef Name='File' /><FieldRef Name='Record' /><FieldRef Name='Field' /></ViewFields></viewFields><rowLimit>0</rowLimit><queryOptions><QueryOptions></QueryOptions></queryOptions></GetListItems></soap:Body></soap:Envelope>
Response Headersview source
Cache-Control:private, max-age=0
Content-Length:1563
Content-Type:text/xml; charset=utf-8
Date:Tue, 19 Nov 2013 13:56:55 GMT
MicrosoftSharePointTeamServices:14.0.0.7102
Persistent-Auth:false
Proxy-Connection:Keep-Alive
Server:Microsoft-IIS/7.5
SPRequestGuid:1292ff30-b96e-461f-84b0-69447b4905b6
X-AspNet-Version:2.0.50727
X-MS-InvokeApp:1; RequireReadOnly
X-Powered-By:ASP.NET
X-SharePointHealthScore:0
Coordinator
Nov 19, 2013 at 5:48 PM
sbpanda:

SPServices does nothing on the authentication front. The SOAP calls are constructed containing only the payload. The browser and server have the authentication "discussion" separately.

There are often issues with authentication, and 99% of the time, it's a network topology or authentication issue that has to do with what site between the browser and the server.

M.
Nov 19, 2013 at 6:49 PM
Thank you Marc for a quick response. I really appreciate it.
Now that you said that the authentication could be browser isssue, I will test the code on different browsers and post my observations.

Honestly, I have primarily noticed this failure on Chrome and on IE, it worked. Since I do majority of my work on Chrome, it would be too early to say if IE works fine all the time.

From your experience, could you suggest what kind of analysis I should do, in case I find out that the authentication problem happens on Chrome (or say any non IE browsers) and works on IE all the time. The thing is, I do not want to restric the users to use IE only.
Coordinator
Nov 19, 2013 at 7:03 PM
I doubt that it's the browser alone. It's usually something in the route. For instance, I've seen improperly configured F5s be a problem.

M.