What event triggers the IdentityManager ChallengeMethod?

2466
2
10-02-2014 08:34 AM
MarcusHarner
Occasional Contributor

I am using IdentityManager to authenticate a layer from ArcGIS Online, which is working great.  I also have several layers, Tiled, Dynamic, and Feature layers, that are coming from other servers that do not need authentication.  I am using the SignInDialogWithTemplate example and the SignIn dialog keeps reappearing (about 20 times) even after a token is retrieved.  Upon running clicking the 'OK' button in a SignIn dialog, the dialog collapses, then comes back (because it is running the 'Challenge' function again). 

Does anyone know the event that triggers the IdentityManager Challenge method? 

Thanks much.

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor

That's likely a referer issue because some services deny access when the referer is not set.

Try setting a default referer that will be used by all requests and by the token generation.

Something like:

   IdentityManager.Current.DefaultReferer = "http://arcgis.com"; // or whatever you want to use as referer

.

DominiqueBroux
Esri Frequent Contributor

I forgot to mention that you can choose any referer with WPF only.

With Silverlight, the referer is automatically set by the browser http stack and you have to generate tokens for a substring of this referer (generally your application URL but depending on the browser).

Something like:

   IdentityManager.Current.TokenGenerationReferer = "http";

0 Kudos