I’m tring to authenticate user to have access to page from extJS. I saw some examples how to do it, but I’m still getting ‘authentication required’ error. How should I do it?
Here’s my code:
Ext.onReady(function() {
var auth = "Basic " + 'user' + ':' + 'password';
// Create store
var myStore = new Ext.data.JsonStore({
// Load data at once
autoLoad: true,
// Override default http proxy settings
proxy: new Ext.data.ScriptTagProxy({
// Call web service method using GET syntax
url: 'http://myotherdomain.com/something.xml',
headers : { Authorization : auth }
})
});
});
Trouble was caused because phrase login:password wasn’t encoded, there was sended pure string. When I encoded it with Base64 authentication was accepted.