Passing SessionID to Fusion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing SessionID to Fusion

GeorgesK
Hello List,

I'm having trouble passing a previously created SessionID to Fusion by using the "SESSION=" parameter. When doing so, Fusion still asks for username and password.
In Internet Explorer 8, when I click cancel on the login prompt, the map is displayed in the browser but using another (automatically created) session. With Firefox (3.6.3), when I cancel, nothing is displayed.

I tried with the Ajax Viewer, and it works fine.

I read those threads (among many others) :
http://n2.nabble.com/fusion-user-authentication-in-MGOS-2-1-final-tp4271459p4271459.html
http://n2.nabble.com/Passing-username-and-password-into-url-with-fusion-tp3860654p3860654.html
I even tried Chris Claydon's solution here without success :
http://n2.nabble.com/Auto-authenticate-when-using-Fusion-Viewer-tp2120380p2123423.html

Has this problem been solved ?. I really would like to use Fusion instead of the Ajax viewer, because of some of its features.
I am using MGOS 2.1 final.

Thanks in advance.

Georges
Reply | Threaded
Open this post in threaded view
|

RE: Passing SessionID to Fusion

Chris Claydon
This issue should be resolved by the two submissions made against Fusion Trac ticket 361:

http://trac.osgeo.org/fusion/ticket/361

If you want to try to hack this into the 2.1 version, find the call to createSessionId() in fusionSF-compressed.js, and replace it with this piece of code:

var passedSessionId = Fusion.getQueryParam('Session');  
if(passedSessionId == null || passedSessionId == ""){  
    createSessionId();  
}else{  
    Fusion.sessionId = passedSessionId;  
}

Chris.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of GeorgesK
Sent: Saturday, April 17, 2010 12:39 PM
To: [hidden email]
Subject: [mapguide-users] Passing SessionID to Fusion


Hello List,

I'm having trouble passing a previously created SessionID to Fusion by using
the "SESSION=" parameter. When doing so, Fusion still asks for username and
password.
In Internet Explorer 8, when I click cancel on the login prompt, the map is
displayed in the browser but using another (automatically created) session.
With Firefox (3.6.3), when I cancel, nothing is displayed.

I tried with the Ajax Viewer, and it works fine.

I read those threads (among many others) :
http://n2.nabble.com/fusion-user-authentication-in-MGOS-2-1-final-tp4271459p4271459.html
http://n2.nabble.com/Passing-username-and-password-into-url-with-fusion-tp3860654p3860654.html
I even tried Chris Claydon's solution here without success :
http://n2.nabble.com/Auto-authenticate-when-using-Fusion-Viewer-tp2120380p2123423.html

Has this problem been solved ?. I really would like to use Fusion instead of
the Ajax viewer, because of some of its features.
I am using MGOS 2.1 final.

Thanks in advance.

Georges
--
View this message in context: http://n2.nabble.com/Passing-SessionID-to-Fusion-tp4918427p4918427.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

RE: Passing SessionID to Fusion

GeorgesK
Thanks a lot ! This solved the problem. In fact, the change I had to make was more extensive than the lines you provided below, since I didn't find any call to createSessionId() in the Fusion 2.1 code. However, thank's to the link to ticket 361, I had the complete code. I publish it below for those who would need it : Original 2.1 fusionSF.js :
var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); 
    if(appDefUrl){
        var xhr = new XMLHttpRequest(); 
        var mapAgentUrl = getAgentUrl(); 
        xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml", false); 
        xhr.send(null); 
Patched version :
var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); 
    if(appDefUrl && (
        appDefUrl.indexOf('Library') == 0 || 
        appDefUrl.indexOf('Session') == 0)){
        var passedSessionId = Fusion.getQueryParam('Session');
        if(passedSessionId == null){ 
            createSessionId();
        }else{
            Fusion.sessionId = passedSessionId;
        }
        var xhr = new XMLHttpRequest(); 
        var mapAgentUrl = getAgentUrl(); 
        xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml&SESSION="+Fusion.sessionId, false); 
        xhr.send(null); 
Since it is fusionSF-compressed.js that is actually called, here is the compressed code for those who want to take the risk :) :
var appDefUrl=Fusion.getQueryParam('ApplicationDefinition');if(appDefUrl&&(appDefUrl.indexOf('Library')==0||appDefUrl.indexOf('Session')==0)){var passedSessionId=Fusion.getQueryParam('Session');if(passedSessionId==null){createSessionId();}else{Fusion.sessionId=passedSessionId;}var xhr=new XMLHttpRequest();var mapAgentUrl=getAgentUrl();xhr.open("GET",mapAgentUrl+"?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID="+appDefUrl+"&FORMAT=text%2Fxml&SESSION="+Fusion.sessionId,false);xhr.send(null);
Thanks once again. Georges
Chris Claydon wrote
This issue should be resolved by the two submissions made against Fusion Trac ticket 361: http://trac.osgeo.org/fusion/ticket/361 If you want to try to hack this into the 2.1 version, find the call to createSessionId() in fusionSF-compressed.js, and replace it with this piece of code: var passedSessionId = Fusion.getQueryParam('Session'); if(passedSessionId == null || passedSessionId == ""){ createSessionId(); }else{ Fusion.sessionId = passedSessionId; } Chris. -----Original Message----- From: mapguide-users-bounces@lists.osgeo.org [mailto:mapguide-users-bounces@lists.osgeo.org] On Behalf Of GeorgesK Sent: Saturday, April 17, 2010 12:39 PM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Passing SessionID to Fusion Hello List, I'm having trouble passing a previously created SessionID to Fusion by using the "SESSION=" parameter. When doing so, Fusion still asks for username and password. In Internet Explorer 8, when I click cancel on the login prompt, the map is displayed in the browser but using another (automatically created) session. With Firefox (3.6.3), when I cancel, nothing is displayed. I tried with the Ajax Viewer, and it works fine. I read those threads (among many others) : http://n2.nabble.com/fusion-user-authentication-in-MGOS-2-1-final-tp4271459p4271459.html http://n2.nabble.com/Passing-username-and-password-into-url-with-fusion-tp3860654p3860654.html I even tried Chris Claydon's solution here without success : http://n2.nabble.com/Auto-authenticate-when-using-Fusion-Viewer-tp2120380p2123423.html Has this problem been solved ?. I really would like to use Fusion instead of the Ajax viewer, because of some of its features. I am using MGOS 2.1 final. Thanks in advance. Georges