PDA

View Full Version : Problems with Basic Auth



macap
21 Mar 2011, 6:36 AM
Hello,

I want to implement a RESTful service with Basic Auth.

My proxy code looks like this:



floorCoveringStore.setProxy({

type : 'rest',
url : Ext.util.Format.format(
'{0}BasicAuthentication/WebServices/REST/AreaService.svc/FloorCoveringList',
localStorage.baseUrl),
reader : {
type : 'json',
root : 'FloorCoveringListResult'
},
headers : {
'Content-Type' : 'application/json;charset=utf-8',
'Authorization': Ext.util.Format.format('Basic {0}', localStorage.base64)
}
});



But I always get a not-authrorized (401 ERROR).

The REST-Sevice itself should work.
When I use Fiddler and create a request with the fiddler request builder:


User-Agent: Fiddler
Authorization: Basic xxxxxxxxxxxxxxxxxxxx==
Host: localhost:52898


It works fine.


Any ideas?

I guess I am using the headers property in the wrong way?


Regards,

Martin