Flex Viewer 3.0 - Secured Service using IdentityManager

2916
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
PanWang
New Contributor
I read this from the Help of Arcgis API for FLEX: "Supplying end users with a user name and password is not appropriate when services from more than one ArcGIS Server system are used in an application, as multiple logins would be required. This limitation does not apply when using multiple services within the same ArcGIS Server system, since the challenge is issued for the entire server" .

It is quite strange that I am actually using multiple services within the same ArcGIS Server system, so the problem of  multiple logins should not happen. But it happens as I described above.
0 Kudos
JosephAccardi
New Contributor III
I'm having the same issue. I'm getting multiple log-in pop-ups for every secured service I have in my application. I hope someone can shed some light on this situation.
0 Kudos
DasaPaddock
Esri Regular Contributor
Does the application work fine once you login to each service?

What version of the Viewer are you testing?

What is the contents of http://localhost/ArcGIS/rest/info ?
0 Kudos
JosephAccardi
New Contributor III
I'm using FV 3.0. Yes, each service works once I provide a log-in for each one. Here's what is says when I go to http://localhost/ArcGIS/rest/info:

Server Info
Current Version: 10.1

SOAP URL: http://<localhost>/arcgis/services

Secure SOAP URL: null

Authentication Information:

Is Token Based Security: true
Token Service URL: http://<localhost>/arcgis/tokens/
ShortLived Token Validity: 60 minutes



I am still in production and haven't pushed my application to the outside yet.

Thanks
0 Kudos
DasaPaddock
Esri Regular Contributor
Are you using 3.0 Prerelease or Beta 1?

What version of 10.1 server are you using?

If you check the traffic using a tool like HttpFox, you should see it first trying to get the json for the layers and the response saying that a token is required, and then after you log in, you should see it trying again with a token added to the request. What is the response to these requests?

[ATTACH=CONFIG]14952[/ATTACH]
0 Kudos
JosephAccardi
New Contributor III
I'm using FV 3.0 Prerelease and 10.1 Prerelease.

I may have misstated my issue. I've noticed that if I log onto the web application as a user who has permissions to all the secured map services featured on the site I only see the log-in pop-up once. However, if I log onto the web application as a user who doesn't have permissions to all the services a log-in will pop up multiple times and errors are generated which say that some of the services could not load (because the user doesn't have permissions to use them).

I guess my question is how can I create a log-in pop-up (or log-in screen) that a user can log-in once and only the services that he/she has permissions to will be populated on the site (without the multiple log-ins or permission errors)?

Thank you for your help on this.
0 Kudos
DasaPaddock
Esri Regular Contributor
In 3.0 final, when the user cancels a login, there won't be an error message displayed.

If you don't want the user to see a login for layers they don't have access to, you could create different Viewers or different configs and then direct users to the appropriate URL.

e.g.,

http://host/viewer1
http://host/viewer2

or

http://host/viewer/index.html?config=config1.xml
http://host/viewer/index.html?config=config2.xml
0 Kudos
ChrisMahon
New Contributor
Did you ever resolve this issue?

I just started a post that sounds like that same issue?
http://forums.arcgis.com/threads/92518-Custom-SignInWindow-will-not-go-away...


I'm using FV 3.0 Prerelease and 10.1 Prerelease.

I may have misstated my issue. I've noticed that if I log onto the web application as a user who has permissions to all the secured map services featured on the site I only see the log-in pop-up once. However, if I log onto the web application as a user who doesn't have permissions to all the services a log-in will pop up multiple times and errors are generated which say that some of the services could not load (because the user doesn't have permissions to use them).

I guess my question is how can I create a log-in pop-up (or log-in screen) that a user can log-in once and only the services that he/she has permissions to will be populated on the site (without the multiple log-ins or permission errors)?

Thank you for your help on this.
0 Kudos
BenjaminMercier
New Contributor III
Are you using 3.0 Prerelease or Beta 1?

What version of 10.1 server are you using?

If you check the traffic using a tool like HttpFox, you should see it first trying to get the json for the layers and the response saying that a token is required, and then after you log in, you should see it trying again with a token added to the request. What is the response to these requests?

[ATTACH=CONFIG]14952[/ATTACH]


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
0 Kudos