Hello,
I'm trying to create a GeoprocessingTask to a secured service, but the only way to do it is to use the method
public static Task<GeoprocessingTask> CreateAsync(Uri uri);
This method requests the metadata from a service, but because the service is private, i get a Token Required exception. Is it possible to pass a token to the method, so that there is no authentication error? I am generating the token by calling the GenerateCredentialAsync method on AuthenticationManager.
We can't use mechanisms like ChallengeHandler or Credentials from AuthenticationManager, because it is a singleton and our server is asynchronous, it should process multiple geoprocessing requests from different arcgis users.
The only workaround we can find is to use an obsolete constructor instead of the method CreateAsync()
var geoTask = new GeoprocessingTask(uri) { Credential = new ArcGISTokenCredential() { Token = token } };
But because it is obsolete, the workaround is temporary. Is there another way to inject token to a GeoprocessingTask?
Thanks in advance,
Michał