Use Secured Service with Citizen Service Request Application

849
3
03-31-2014 10:42 AM
Labels (1)
JakeSkinner
Esri Esteemed Contributor
I'm trying to use a secured service with the Citizen Service Request application.  I've added the dojo.require("esri.IdentityManager") to the application as stated in this sample, but I'm never prompted for a username/password.  I receive the error:

dojo.io.script error Error: Token Required

Has anyone successfully added a secure service to this application?
0 Kudos
3 Replies
BrianLord1
Occasional Contributor
Jake,

Do you already have a proxy page set up and working?  I currently have this app running using a secured service and did initially have the same problem with the identity manage.  I tried quite a few things so I cannot remember exactly what fixed the problem.

I know one of my problems was that I did not have my proxy set up correctly at first.

Thanks,
Mark
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Hi Mark,

Yes, I set up the proxy page, but still receive the same error.  Ex:

<?xml version="1.0" encoding="utf-8"?>
<ProxyConfig mustMatch="true">
    <serverUrls>
        <serverUrl matchAll="true" url="http://<server>/arcgis/rest/services/"></serverUrl>
        <serverUrl matchAll="true" url="http://<server>/arcgis/rest/services/"></serverUrl>       
    </serverUrls>
</ProxyConfig>


I also configured the application to always use the proxy in the homepage.js file:

esri.config.defaults.io.proxyUrl = "proxy.ashx";
esriConfig.defaults.io.alwaysUseProxy = true;


The result is the same whether I set this to 'true' or 'false'.
0 Kudos
JakeSkinner
Esri Esteemed Contributor
I was able to get the issue resolved thanks to Jon Uihlein.  He suggested to make the following changes:

In default.htm

1) baseMapGallery.js is included twice. Delete the first.

2) Use these ESRI stylesheets:
     <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
    <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">

3) Change the color of the text on the login panel (it is white on white currently)
    .esriSignInDialog{
      color:#000;
    }

4) Add class=�?�claro�?� to the body tag

In homePage.js

Add the following function call to the end of the map onLoad event (line 380~)

// place under line: map.setExtent(startExtent);
HideProgressIndicator();
0 Kudos