title: Programmatically accessing a resource hosted behind WebSEAL reverse proxy
body: <ul>
  <li>We have an iPad app displaying contents from drupal site (serving just json files). </li>
  <li>our IT dept placed a SSO in front of the drupal site. WebSEAL is used for implementing SSO. </li>
  <li>so when we access the drupal site from the browser we are redirected to login page (forms authentication) and we need to enter our windows user name &amp; password to proceed.</li>
  </ul>
  
  <p>when we tried to access the json files from ipad we are getting 401 status with html contents with url to login page. we tried to use basic authentication by sending username and password in the header but it did not worked. googling did not gave any useful solutions. </p>
  
  <p>is anyone had similar issue? i just need a way authenticate with username and password from non-browser client.</p>
  
  <p>sample node js code</p>
  
  <pre><code>var http = require('http');
  
  
  var username = 'username';
  var password = 'password';
  var auth = "Basic " + new Buffer(username + ":" + password).toString("base64");
  
  
  var options = {
    host: 'devhome.intranet.example.com',
    port: 80,
    path: '/app/api/rest/views/category.json',
    headers : {
      "Authorization" : auth
    }
  };
  
  http.get(options, function(res) {
    console.log("Got response: " + res.statusCode);
    console.log(res);
  }).on('error', function(e) {
    console.log("Got error: " + e.message);
  });
  </code></pre>
  
  <p>any help is highly appreciated.</p>
  
  <p>thx</p>