Flex Viewer 3.0 - Secured Service using IdentityManager

2880
16
06-03-2012 09:59 PM
PanWang
New Contributor
I am trying to use a new function in Flex Viewer 3.0: "Edit secure service" (http://resourcesbeta.arcgis.com/en/help/flex-api/samples/index.html#/Edit_secure_service/01nq0000007...). I have already set up the configurations in ArcGIS Server and it seems working fine when I connect a map service with the right user name and password. But when it comes to multiple services, the log-in window pops up repeatedly for each services, even though they have access to the same role.

For example, when I try to use 3 services in my opreational layer:


       <operationallayers>
             <layer label="Service1" type="dynamic" visible="false" 
                   url="http://localhost/ArcGIS/rest/services/Service1/MapServer"/>
            <layer label="Service2" type="dynamic" visible="false" 
                   url="http://localhost/ArcGIS/rest/services/Service2/MapServer"/>
            <layer label="Service3" type="dynamic" visible="false" 
                   url="http://localhost/ArcGIS/rest/services/Service3/MapServer"/>
      </operationallayers> 


all the services are protected and accessible to only one role in ArcGIS server:

[TABLE="class: grid"]Service Allowed roleuser_namepasswordService1 staff staff1 staff1$Service2 staff staff1 staff1$Service3 staff staff1 staff1$
[/TABLE]


But when Flex Viewer starts, the log-in window pops up 3 times for each service, which is unnecessary for they are using the same user name and password!

Did anyone meet the same problem before, and have a solution to it ? Thanks in advance!
Tags (2)
0 Kudos
16 Replies
DasaPaddock
Esri Regular Contributor
Hi Dasa,

I got a problem with the request POST when I log, actually, it send to the URL http://.../generateToken but I would like, like on yours, https://..../generateToken, could you explain me how to do that??

Thanks in advance,

Ben


What is the Token Service URL shown at: http://[host]/arcgis/rest/info
0 Kudos
BenjaminMercier
New Contributor III
Hello,

Thanks for your answer. This info return the URL of the intern server of the company if I use this url request: "http://vwpfr010app134:6080/arcgis/rest/info
Authentication Information:
But we have recently installed a web adaptor to access our web applications from everywhere to this adress: https://sygdev.systra.info/arcgis/rest/info and here is the result:

Authentication Information:

From applications I use in extern, I use the second url, so I don't know why generateTokens URL don't use an https request...

I hope you understand me.

Ben

PS: I don't understand why this url is slow to answer...
0 Kudos
DasaPaddock
Esri Regular Contributor
Can you double-check that your application is using the web adapter URL? You can use the Chrome Dev tools to see the network requests. Also, do yo have a public URL to your app?

One problem may be that I get a SSL certificate error ("host name mismatch") when loading https://sygdev.systra.info/arcgis/rest/info
0 Kudos
BenjaminMercier
New Contributor III
Hi Dasa,

To answer your question:
1) Yes this application use https://sygdev.systra.info/test so it's the web adaptor URL
2) The genrate token URL use http://sygdev.systra.info/arcgis/tokens which actually not exist, I don't understand why it use that.


We'll have to buy a domain name befre having a certificate. I hope...

Ben
0 Kudos
DasaPaddock
Esri Regular Contributor
Hi Ben,

I found that the problem is that the JSON /rest/info response used by the app is returning the URL as just http. See the tokenServicesUrl at: https://sygdev.systra.info/arcgis/rest/info?f=pjson

This may be a server bug. It is being investigated.

Are you compiling your Viewer? If you are, I can show you how to update the code so that it doesn't use the /rest/info response.
0 Kudos
BenjaminMercier
New Contributor III
Hi Dasa,

Well found !!
For my job I use source code of ArcgIS Viewer For Flex, but usually, the others are publishing web app with the 3.3 application builder...
I guess it should be a parameter of the ArcGIS Server or something else to do with the web adaptor...

Thanks so much. Tell me if you have something new.
0 Kudos
BenjaminMercier
New Contributor III
Hi Dasa,

I found where to modify this parameter finally...
It's located in the http://yourArcGISServerURL/arcgis/admin/security/config folder. In Update I had to choose "HTTP or HTTPS" protocol or "HTTPS Only".

Thanks you Dasa to find from where I had the problem.

Ben
0 Kudos