Getting a 401 Unauthorized access error

364 views
Skip to first unread message

Joe G

unread,
Dec 11, 2015, 10:49:31 AM12/11/15
to PHRETS

I have been consistently getting a 401 Unauthorized access error when trying to connect.  Using the browser directly works, so the credentials appear to be ok.  Portion of feedback:

< HTTP/1.1 401 Access Denied
< Cache-Control: no-cache
< Content-ID: 123456
< Content-Type: text/html
< Date: Fri, 11 Dec 2015 05:33:17 GMT
< Expires: -1
< Pragma: no-cache
< RETS-Version: RETS/1.5
< Server: Microsoft-IIS/7.5
* Authentication problem. Ignoring this.
< WWW-Authenticate: Digest realm="MATRIX", nonce="MjAxNS0xMi0xMSAwNjozMzoxOC41ODc", opaque="0000000000000000", stale=false, algorithm=MD5, qop="auth"
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Content-Length: 1293
< Connection: keep-alive

Full debug info attached...


rets_debug.txt

Christopher Reichert

unread,
Dec 11, 2015, 12:07:53 PM12/11/15
to PHRETS
Most of the time I've seen the error you posted, it's been due to a typo in the credentials or a permissions error with the RETS server (which required reaching out to them).

- Are you sure you get back a correct response when using the browser? e.g. a dictionary with different key-value pairs.

- Are you using the correct user agent and/or user agent password?

There are a few other things worth checking but this would be my first step.

Regards,
-Christopher

Joe G

unread,
Dec 11, 2015, 12:28:29 PM12/11/15
to PHRETS
Hi Christopher,

The permissions seem ok.  When I hit the Login url in a browser with the supplied credentials, this is the response I get:

<RETS ReplyCode="0" ReplyText="Operation Success."><RETS-RESPONSE>
MemberName=
User=xxxxxxxx,NULL,NULL,xxxxxxxx
Broker=
MetadataVersion=1.11.72953
MetadataTimestamp=2015-12-01T02:54:13Z
MinMetadataTimestamp=2015-12-01T02:54:13Z
Login=http://matrixrets.hicentralmls.com/rets/Login.ashx
Logout=http://matrixrets.hicentralmls.com/rets/Logout.ashx
Search=http://matrixrets.hicentralmls.com/rets/Search.ashx
GetMetadata=http://matrixrets.hicentralmls.com/rets/GetMetadata.ashx
GetObject=http://matrixrets.hicentralmls.com/rets/GetObject.ashx
Update=http://matrixrets.hicentralmls.com/rets/Update.ashx
PostObject=http://matrixrets.hicentralmls.com/rets/PostObject.ashx
</RETS-RESPONSE></RETS>

The login credentials were copied / pasted into the accessing script, so are the same as what was used in the direct browser request.  No specific user agent requirements were provided by the MLS, although I did try copying the exact user agent string my browser had been using and using that in the script, but that yielded the same results.

Any thoughts?

Best,
Joe

Christopher Reichert

unread,
Dec 11, 2015, 12:32:53 PM12/11/15
to PHRETS
Do the credentials work with http://retsmd.com/?

-Christopher

Joe G

unread,
Dec 11, 2015, 1:12:05 PM12/11/15
to PHRETS
Yes - output attached...
retsmd.png

Joe G

unread,
Dec 11, 2015, 3:29:08 PM12/11/15
to PHRETS
I decided to try this on another machine, and discovered that access DOES work off our server.  So, same script, same credentials, off a different server is able to connect to the MLS without issue.  I thought perhaps it was something with my local apache config, but I tried spinning up a quick PHP server instance, and had the same problem.  Also tried shutting off my local firewall (just in case) -- also made no difference...

Leo Tse

unread,
Jun 11, 2016, 6:25:59 PM6/11/16
to PHRETS
Hi Joe,

If you're using Windows and your Windows was not activated when you installed your localhost software (XAMPP, WAMP, etc), then you will get a 401 error. If that's your situation, just simply get a CD key and activate your Windows, then re-install your localhost software. 

The same issue happened once for my colleague's computer, and that's how we solved it.
Reply all
Reply to author
Forward
0 new messages