Select to view content in your preferred language

token slamming

635
2
06-06-2013 11:12 AM
Labels (1)
VincentDolan
Occasional Contributor
I am seeing "token slamming" = we are getting multiple challenges/tokens in a short amount of time.
    [note: on startup, I have IdentityManager's .ChallengeMethod set to GetCredentialsChallengeMethod()]

    Here's what I saw (earlier today, in just three seconds from 1:30:52 - 1:30:54)

       1) our challengemethod GetCredentialsChallengeMethod() is called by ESRI dll as our token expires
          we keep track of the callback method (that ESRI wants us to call later) using class field m_esriProvidedCallback

       2) our method GetCredentialsChallengeMethod() then calls [IdentityManager.]Current.GenerateCredentialAsync(), asking for a callback to HandleCredentialResponse() when credential is available

       3) ESRI dll passes along a new credential by calling our HandleCredentialResponse()
          we keep track of this latest received credential using class field m_credential
          then, we make the callback ESRI wants us to via m_esriProvidedCallback

       4) the credential is exipring in 2 minutes, but we immediately get ANOTHER challenge (the above steps are repeated)

       5) again, that new credential is exipring in 2 minutes, but we immediately get ANOTHER challenge (the above steps are repeated)

Any ideas?
Thanks.
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Could you use fiddler to look at the error returned by the service at step 4)? That could give a clue.

Note that if you access to hosted or federated services, you have to set a default referer for the token generation (something like IdentityManager.Current.TokenGenerationReferer = "arcgis.com") because hosted and federated services don't support tokens associated to an IP address.

It's even a good practice to set a referer as soon as you access to a portal.
0 Kudos
VincentDolan
Occasional Contributor
Thanks, Dominique- setting .TokenGenerationReferer seems to have fixed it!
0 Kudos