[fusion-trac] #263: Passing SESSION in Firefox still prompts for authentication

Fusion trac_fusion at osgeo.org
Fri Jun 26 17:37:16 EDT 2009


#263: Passing SESSION in Firefox still prompts for authentication
------------------------+---------------------------------------------------
   Reporter:  amorsell  |       Owner:  madair
       Type:  defect    |      Status:  new   
   Priority:  P1        |   Milestone:  Future
  Component:  Core      |     Version:  SVN   
   Severity:  Critical  |    Keywords:        
External_id:            |       State:  New   
    Browser:  All       |          Os:  All   
------------------------+---------------------------------------------------
 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:

 http://n2.nabble.com/MGE-2010%3A-fusion-pre-authentication-(autologin)-no-
 longer-works-td2592934.html

 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.

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/263>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list