-
1 Mar 2012 7:34 AM #1
Setting username and password in proxy/store
Setting username and password in proxy/store
How can I inside the store/proxy setup a username and password to access a web service/rest/ajax etc without prompting?
For example I have a delicious account I want to retrieve a set of urls from, for this I need to supply a username and password in order to login and get the data from my account
-
1 Mar 2012 8:00 AM #2
Is this standard HTTP/Basic Auth or some other mechanism?
Aaron Conran
@aconran
Sencha Architect Development Team
-
2 Mar 2012 2:37 AM #3
For now basic auth - specifically access to http://www.delicious.com/ which requires a username and password
-
2 Mar 2012 9:07 AM #4
I learned this morning that BasicAuth is nothing more than a header which has base64 encoded username:password.
http://coderseye.com/2007/how-to-do-...h-in-ajax.html
http://www.aswinanand.com/2009/01/ht...on-using-ajax/
Setting the headers on the proxy object will enable you to do this.Aaron Conran
@aconran
Sencha Architect Development Team
-
24 Jan 2013 8:14 AM #5
And how can I access the header on JSONP? Via property extraParams?
-
24 Jan 2013 10:21 AM #6
It's not possible directly on the client-side. Take a look at this stackoverflow question.
http://stackoverflow.com/questions/4...cript-requestsAaron Conran
@aconran
Sencha Architect Development Team
-
25 Jan 2013 9:43 AM #7
Did not solve my problem.
I have now included a button, where I make manually an ajax call to URL.
It is successful, also looking into the header -> Authorization parameter is set.
But the Authorization parameter is still missing in the JSONP requests. Same URL as above.Code://try to contact the server var auth = 'XXX'; var url = 'http://xxx'; // ExtJS Ext.Ajax.request({ url : url, method : 'GET', headers : { Authorization : 'BASIC ' + auth } });
When entering my Basic Auth information into the popup in the browser, every JSONP requests includes the Authorization parameter - but in an iOS Webview that popup does not appear and therefore I cannot enter the auth information.
Any further help?
-
28 Jan 2013 11:45 AM #8
It's not possible to send additional headers on a script tag/jsonp request.
Aaron Conran
@aconran
Sencha Architect Development Team


Reply With Quote