Http resources protected with basic authentication
Hi,
Why are the http resources protected with basic authentication not available anymore?
I get all the data from services with basic authentication to show in the application.
It doesn't make sense for the user to enter a username and password to use the application.
Thank you!
Re: Http resources protected with basic authentication
What resources are you talking about ?
Re: Http resources protected with basic authentication
I did a symbian web runtime app and I get the data with a javascript ajax call to a web service that has basic authentication.
This web service replies with a xml with the data I need and I parse it with javascript to show inside the app.
Re: Http resources protected with basic authentication
And excatly where in there are you having problems ?
Re: Http resources protected with basic authentication
Since the new update in Symbian Browser (Anna) when I open the application a login box opens to enter the username and password.
So the users can't access the application.
Re: Http resources protected with basic authentication
Hi,
Indeed there seems to be issue with the Browser 7.3.1.37 on passing username and password
[code]
xmlHttpReq.open("GET", url,true, user, pass); //does not work
[/code]
What you can do to workaround this problem is to generate Authorization header by yourself.
You'll need base64 encoded username and password pair separated by semicolon. I was using following library and it worked OK.
[url]http://www.webtoolkit.info/javascript-base64.html[/url]
[code]
var auth = Base64.encode(user+':'+pass);
[/code]
Then in XMLHttpRequest set custom Authorization Header and declare it to be "Basic" type.
[code]
xmlHttpReq.setRequestHeader("Authorization", "Basic "+auth);
[/code]
Please note that in URL authentication support was dropped intentionally. If your widget was using it, please start using the workaround.
[url]http://www.developer.nokia.com/Community/Wiki/KIC001677_-_Automatic_HTTP/HTTPS_authentication_in_URLs_discontinued_in_Browser_7.3[/url]
Br,
Ilkka
Re: Http resources protected with basic authentication
Thanks a lot!
It worked really well!