[fusion-users] Auto-authenticate when using Fusion Viewer

hfonseca hugofonseca at cm-mealhada.pt
Mon Apr 20 13:44:02 EDT 2009


Hi all,

I'm newbie with fusion..but started to learn here at the forum how to
setting up layouts.
my server is IIS and my fusion layout is *.html. When i run maestro i can
preview my layout and map correctly. 
If I type
"http://myserver/mapguide/fusion/templates/mapguide/mylayout/index.html" on
browser only see the html layout and not the map. Well the problem is the
auto-authentication at the MG, ie, APPLICATIONDEFINITION and SESSION
parameters.

I don't understand nothing of html or IIS servers....How can i add this
script to my index.html in order to get my map at fusion layout? Or this can
be made in other way?
 
hope someone can help me!!

thanks,
Hugo


Chris Claydon wrote:
> 
> Ideally, the Fusion code would be updated to allow you to specify USERNAME
> and PASSWORD the same way that the AJAX Viewer does. Until that happens,
> there is a workaround...
> 
> Fusion allows you to authenticate with a session ID. Here's a simple php
> script that creates a session using the 'Anonymous' user and re-directs to
> the template of your choice...
> 
> <?php
>     $fusionMGpath = './MapGuide/php/';
>     include $fusionMGpath . 'Common.php';
> 
>     $locale = GetDefaultLocale();
>     $appdef = "";
>     $template = "";
>     $session = $siteConnection->GetSite()->CreateSession();
> 
>     GetRequestParameters();
> 
>     $viewerSrc = 'templates/mapguide/' . $template . '/index.html';
>     $viewerSrc = $viewerSrc . '?APPLICATIONDEFINITION=' . $appdef;
>     $viewerSrc = $viewerSrc . '&SESSION=' . $session;
> 
>     header( 'Location: ' . $viewerSrc ) ;
> 
>     function GetParameters($params)
>     {
>         global $appdef, $template;
> 
>         $appdef = $params['APPLICATIONDEFINITION'];
>         $template = $params['TEMPLATE'];
>     }
> 
>     function GetRequestParameters()
>     {
>         if($_SERVER['REQUEST_METHOD'] == "POST")
>             GetParameters($_POST);
>         else
>             GetParameters($_GET);
>     }
> 
> ?>
> 
> Save this script in a file called something like FlexViewer.php, and drop
> it in the www/fusion folder in the MapGuide web tier. You can then link to
> it using a URL that includes the parameters APPLICATIONDEFINITION and
> TEMPLATE. E.g.
> 
> http://myserver/mapguide20xx/fusion/FlexViewer.php?APPLICATIONDEFINITION=Library%3a%2f%2fSheboyganSandbox.ApplicationDefinition&TEMPLATE=Slate
> 
> You should no longer need to authenticate.
> 
> Note that in MG 2010, the fusionMGpath parameter will change to
> './Layers/MapGuide/php/' but the rest of the script should still be fine.
> 
> Chris.
> 
> From: fusion-users-bounces at lists.osgeo.org
> [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Praveen
> Rajendra Babu
> Sent: Tuesday, January 06, 2009 6:28 PM
> To: fusion-users at lists.osgeo.org
> Subject: [fusion-users] Auto-authenticate when using Fusion Viewer
> 
> Hello,
>        I am working to do auto-authentication when using any off the
> Fusion templates. Can anyone direct me on the code to look at?
> I was able to figure out with .NET AJAX
> viewer(mapviewernet\mainframe.aspx) but could n't see something similar to
> that under "fusion" sub-directory.
>     Also, is there any code-level documentation one could look at to get a
> deeper understanding on Fusion's implementation?
> 
> Thanks again for your time. Appreciate it.
> 
> Regards,
> Praveen
> 
> 
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Auto-authenticate-when-using-Fusion-Viewer-tp2120380p2665097.html
Sent from the Fusion Users mailing list archive at Nabble.com.



More information about the fusion-users mailing list