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 :
<pre>
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);
</pre>
Patched version :
<pre>
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);
</pre>
Since it is fusionSF-compressed.js that is actually called, here is the compressed code for those who want to take the risk :) :
<pre>
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);
</pre>
Thanks once again.
Georges
<blockquote class="quote light-black dark-border-color"><div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Chris Claydon wrote:</div>
<div class="quote-message">
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
</div>
</div></blockquote>
<br><hr align="left" width="300">
View this message in context: <a href="http://n2.nabble.com/Passing-SessionID-to-Fusion-tp4918427p4926459.html">RE: Passing SessionID to Fusion</a><br>
Sent from the <a href="http://n2.nabble.com/MapGuide-Users-f1803227.html">MapGuide Users mailing list archive</a> at Nabble.com.<br>