02-23-2012 02:00 PM
Hi,
in one application I wanted to open a url and passing username and password for normal http authentification. For example:
function init() {
window.location = "https://user:password@mydomain.org/mobile/";
}
In the browser its working fine, but as a webworks application I get an "Invald Url". Any recommendations to solve this in a different way?
02-27-2012 11:16 AM
Is this for the Smartphone SDK? if so, the problem is the underlying BrowerField J2ME object does interpret the URL correctly as the browser.
Its very important to recognize that BrowserField != browser
The only thing in common between these two should be the rendering engine they share - how page content is displayed. The functionality & interaction of content such as links / caching / etc. are separate, and it is often in these places that we see a disconnect between behavior of the browser and a WebWorks app:
A clean solution doesn't jump to mind, unfortunately. What I could suggest is using XmlHttpRequest to send an asyncronous request to mydomain.org, providing the credentials as part of the xhr.open() . That might allow your webserver to receive a regular HTTP request like this:
window.location = "https://mydomain.org/mobile/";
because you have already authenticated with the server?