estately / rets

A pure-ruby library for fetching data from RETS servers
https://github.com/estately/rets
127 stars 94 forks source link

Auth/Logout Failure #197

Closed hiattp closed 8 years ago

hiattp commented 8 years ago

We're attempting to use this library for the RLS IDX Feed from Stratus Data for REBNY (New York). Seems like everything should be straight forward (at least login and logout). But this is what we see:

> client = Rets::Client.new({ version: 'RETS/1.5', login_url: 'http://rebny-idx.stratusdata.com:XXX/rets/login', username: 'XXX', password: 'XXX'})
=> #<Rets::Client:0x007ffe73d6fc58 @options={:version=>"RE ... }>
> client.login
=> {"broker"=>"NONE", "membername"=>"XXX", "metadataversion"=>"1.00.00001", "minmetadataversion"=>"1.00.00001", "user"=>"XXXX", "changepassword"=>"http://rebny-idx.stratusdata.com:XXX/rets/changePassword", "login"=>"http://rebny-idx.stratusdata.com:XXX/rets/login", "logout"=>"http://rebny-idx.stratusdata.com:XXX/rets/logout", "search"=>"http://rebny-idx.stratusdata.com:XXX/rets/search", "getmetadata"=>"http://rebny-idx.stratusdata.com:XXX/rets/getMetadata", "getobject"=>"http://rebny-idx.stratusdata.com:XXX/rets/getObject", "update"=>"http://rebny-idx.stratusdata.com:XXX/rets/update", "balance"=>"XXX", "timeoutseconds"=>"1800"}
> client.logout
=> ...HTTP Status 401 Unauthorized... This request requires HTTP authentication ()....

So essentially login is fine but logout fails, and other queries I've tried (i.e. find) show an unauthorized response as well. Are we using this client incorrectly or might REBNY be incompatible for some reason?

dougcole commented 8 years ago

That's surprising. It looks like the login was successful, as you the response has all of the capability urls that I would expect the server to send back on a successful login. You said you get a similar 401 Unauthorized response when trying to search as well?

I don't see any problems with how you're using the client. I'd try using something like wireshark to capture all of the HTTP traffic, send that to the MLS and ask them for help. Some MLSes have small idiosyncrasies that give poor feedback like this, rather than a clear message of the problem. If it does turn out to be a bug in this library please re-open this issue and let me know what you've found!