3.2.0

XMLHTTPRequest Authentication Bug & Solution

I have been implementing the grid with an application to browse a user directory for our organization. The grid object captures the search form values and performs a request that returns a basic XML file that populates the grid. Then I create a link on the name column that does a custom XMLHTTPRequest for a detailed HTML view of that user and loads it in a floating panel in front of the grid.

Everything worked nicely in our test environment but when we moved it to the production area that required authentication the grid forced us to re-enter our username and password *every* time we performed a new search in Firefox. On the other hand, the custom request that I was sending for the detail view did not.

It turns out that in grid.js if a username and password are not set by default it sets them to null and performs the request. This does not cause a problem in IE but in Firefox it attempts to authenticate automatically and fails, then prompts the user over and over. I found the following line in grid.js:

this._http.open(this._requestMethod,URL,this._async,this._username,this._password);

this._username and this._password are the values set to null by default, so I simply removed them so the line looks like this:

this._http.open(this._requestMethod,URL,this._async);

It worked with no problem after that. Another workaround to this problem would be to capture the username and password for your user and use the methods to set the username and password in the grid, but then those credentials would be visible in the JavaScript source code which isn’t very secure.

I hope this helps somebody else out there. By the way, is there a copy of grid.js that has proper formatting so it is readable? Having the whole thing on one line made it VERY hard to search through and debug.

Thanks!
Morgan Whitney
August 3,
Yeah it's in the download under source not runtime
August 4,

This topic is archived.

See also:


Back to support forum