IdentityManager Question

Discussion created by brassier on Jun 24, 2013
Latest reply on Jun 26, 2013 by dbroux-esristaff
To programmatically generate a token, it seems that we must set the IdentityManager.Current.ChallengeMethod to the proper method which can give user/pw, and then call GenerateCredentialAsync from within the challenge method. That method then also raises callback actions that were passed to it, and uses options that were passed to it. This can be seen in the SDK Sample: Datasources->Web Maps->Load Secure WebMap.

My question is, what functionality in the SDK will actually trigger the challenge method being called? It seems to be triggered when actually using a service that needs a token, via certain SDK objects (e.g. document.GetMapAsync). We want to programmatically generate this token when starting our application, and not wait for an unknown SDK object to trigger the call of the challenge method. Is this possible?