Select to view content in your preferred language

Change in identity manager between 2.5 and 2.6

2802
45
Jump to solution
01-31-2012 07:22 AM
JeffPace
MVP Alum
My identity manager works at 2.5.  I don't have any custom code in it at the moment, it just hits the first secure service and prompts for login (AWESOME THANK YOU)

when I change my application to 2.6, firebug throws and error saying

tokenserviceurl not defined

and hangs login.

What changed?
0 Kudos
45 Replies
derekswingley1
Frequent Contributor II
The Identity Manager API ref documents esri.id:  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/identitymanager.htm

IdentityManager is a singleton class and is automatically instantiated into esri.id when the module containing this class is imported into the application. Because IdentityManager extends esri.IdentityManagerBase it inherits all of the IdentityManagerBase class properties and methods.
0 Kudos
JeffPace
MVP Alum
The Identity Manager API ref documents esri.id:  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/identitymanager.htm


awesome thank you, thats what i get for only looking in identitymanagerbase and not realizing that identitymanager extends it.

Thanks again
0 Kudos
BenSayers
New Contributor II
Hi there,
I am hoping Jeff or Derek will be able to help me.
I have a secure site running in AGS 10.04 using the JS API 2.8.
I am having trouble getting the legend widget to display the icons for the layers in IE. All works fine in Chrome, FF and Safari but in IE I get the red cross error.
All worked fine before I switched to https. I've read several posts which suggest its something to do with the token service not authenticating the legend, but I am stuck as to how to correct this.
The code quoted below seems like it should be what I need but I'm unsure how to hook this in.
Is there something I can force in my proxy.jsp page? Or hardcode in my .js page?
Any help or suggestions would be most welcome.
Many thanks,
Ben Sayers


The onLegendLoad function
     onLegendLoad: function(response, ioArgs) {
                var minScale=591657527.591555;
                var maxScale=0;
                if(!this.tocScales[ioArgs.args.layerName]){
                      this.tocScales[ioArgs.args.layerName]={response:response, ioArgs:ioArgs};
                }
                dojo.forEach(response.layers, dojo.hitch(this,function(layer){
                    dojo.forEach(layer.legend, dojo.hitch(this, function(legend){
                        var legendUrl=    legend.url;
                        if(legendUrl.length<10){
                        legend.url =  ioArgs.url.replace("legend?f=json&token=",layer.layerId+"/images/"+legendUrl+".png?token=");
                        legend.url =  ioArgs.url.replace("legend?f=json",layer.layerId+"/images/"+legendUrl+".png");
                        }
                        minScale=layer.minScale;
                        maxScale=layer.maxScale;
                        if(minScale==0){
                            minScale=591657527.591555;
                        }
                        if((minScale==0&&maxScale<=1)||(this.currentScale>maxScale&&this.currentScale<minScale)){
                            layer.scaleVisible=true;
                        }else{
                           layer.scaleVisible=false;
                        }
                    }))                    
                }))
         this.layersInfoLegend.push(response.layers);              
     },

0 Kudos
JeffPace
MVP Alum
Are you manually building a legend?

if so then you can add the token to the params prior to making the legend request

if(document.location.protocol==="https:"){
   if(esri.id.credentials.length>0){
                            params.content["token"]=esri.id.credentials[0].token;
   }
                    }




Hi there,
I am hoping Jeff or Derek will be able to help me.
I have a secure site running in AGS 10.04 using the JS API 2.8.
I am having trouble getting the legend widget to display the icons for the layers in IE. All works fine in Chrome, FF and Safari but in IE I get the red cross error.
All worked fine before I switched to https. I've read several posts which suggest its something to do with the token service not authenticating the legend, but I am stuck as to how to correct this.
The code quoted below seems like it should be what I need but I'm unsure how to hook this in.
Is there something I can force in my proxy.jsp page? Or hardcode in my .js page?
Any help or suggestions would be most welcome.
Many thanks,
Ben Sayers
0 Kudos
BenSayers
New Contributor II
Are you manually building a legend?

if so then you can add the token to the params prior to making the legend request

if(document.location.protocol==="https:"){
   if(esri.id.credentials.length>0){
                            params.content["token"]=esri.id.credentials[0].token;
   }
                    }


I am using the legend widget. So I am using:
var legend = new esri.dijit.Legend({
                        map: map,
                        layerInfos: legendLayers
                    }, "legendDiv");
    

                    legend.startup();

                });


Any ideas?
0 Kudos
JeffPace
MVP Alum
you are not going crazy.  I just opened my secure site in IE (something i try to never do) and the default legend widget is broken for us also.  Non secure services work fine, but secure ones do not.  (red x)

Looks like ESRI did not implement the fix they suggested to me in their own widget.

Could you please start a new thread saying the default legend widget doesnt work over https in IE? this one is already marked as answered and might not get as much attention.
0 Kudos