- We have an iPad app displaying contents from drupal site (serving just json files).
- our IT dept placed a SSO in front of the drupal site. WebSEAL is used for implementing SSO.
- 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 & password to proceed.
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.
is anyone had similar issue? i just need a way authenticate with username and password from non-browser client.
sample node js 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);
});
any help is highly appreciated.
thx