Domanda

I have an ASP.Net (MVC) web app that uses forms authentication (SimpleMembershipProvider). I also have a Flex GIS Viewer application that was developed using the Flex builder.

I can connect to the underlying map services by calling arcgis web method GetToken() from my web app (written in c#), and using the token provided for making map service calls (using JavaScript). I wrongly thought that I would be able to pass the token to the Flex Viewer app, or at least maintain a session with the map service once I connected.

Is there some way of providing this token to Flex Viewer so that users do not have to provide credentials twice (web app and flex viewer)? I was thinking in the URL maybe, as I understand the Flex Viewer needs a token for every map service call.

Or am I on the wrong path altogether? My approach would be to use JavaScript instead of flex as I can make that work, but I want to avoid redoing the web viewer if I can help it.

È stato utile?

Soluzione

Answering my own question... my initial approach was wrong. There is no way of passing the token as a query parameter to the Flex Viewer app.

The solution was to have my application proxy requests from the Flex Viewer application - I just copied the proxy.config and proxy.ashx files to the root of my app.

The user first authenticates via the web app (forms authentication), and then a link to the Flex Viewer is loaded. The map service requests are sent from the Flex Viewer to my web application (had to configure the Flex Viewer and widgets to use a proxy). The web app then checks that the user is authenticated, before dynamically requesting a token from ArcGIS to accompany the original map service request.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top