Ticket #263 (closed defect: fixed)
Passing SESSION in Firefox still prompts for authentication
| Reported by: | amorsell | Owned by: | madair |
|---|---|---|---|
| Priority: | P1 | Milestone: | 2.0 |
| Component: | Core | Version: | SVN |
| Severity: | Critical | Keywords: | |
| Cc: | External ID: | ||
| state: | New | Browser: | All |
| Operating System: | All |
Description
If a valid SessionID is passed as a SESSION URL parameter, Firefox is still presenting the user authentication dialog. This is new behavior in 2.0 beta (or whatever version is with MGOS 2.1 beta). Internet Explorer works fine, however. Related threads:
And, another user provides this information:
The Firefox issue is fairly straightforward to fix, except for my lack of understanding of the actual cause of the issue.
In ApplicationDefinition.js, the method getAppDef(xhr) needs to be changed to be like this:
getAppDef: function(xhr){
if (xhr && typeof(xhr) == "object" && xhr.responseText) {
this.sessionId = xhr.responseText; Fusion.sessionId = this.sessionId;
} var r = new
Fusion.Lib.MGRequest.MGGetResourceContent(this.applicationDefinition);
r.parameters.session = this.sessionId; r.parameters.format = 'application/json'; this.oBroker.dispatchRequest(r,
OpenLayers.Function.bind(this.getAppDefCB, this));
}
Basically what happens is that this function is called by this line of code: "window.setTimeout(OpenLayers.Function.bind(this.getAppDef,this),5);". For a reason that I couldn't identify due to lack of time, the value of xhr is sometimes equal to 5. Therefore, this causes the code to go into assigning 5.responseText (undefined) to this.sessionId and making it require to login again.
I'm guessing it has something to do with an underlying library doing some funky binding/prototyping under Firefox, but I didn't have time to find the cause. My fix only works because it makes sure the xhr parameter is an object and has the responseText parameter, so it's not really a "clean" fix per say, but atleast it makes things work under Firefox.
