AnsweredAssumed Answered

GeodatabaseSyncTask + token

Question asked by arned on Aug 25, 2015
Latest reply on Sep 4, 2015 by arned

Hi all!


Does any one know if it is possible to sync geodatabase using service that requires autentication (token)?


Generate geodatabase works fine with token, but when I try to sync my geodatabase back to server, it fails.

I am using a pregenerated long term token.


In fiddler I can se this response {"error":{"code":499,"message":"Token Required","details":[]}} after 401 challange,

I don't se any token in the post request, so I belive the problem is in my code or a bug in the .NET runtime.


My code:

var taskParameters = new SyncGeodatabaseParameters()


    RollbackOnFailure = false,

    SyncDirection = Esri.ArcGISRuntime.Tasks.Offline.SyncDirection.Upload


var gdbTask = new GeodatabaseSyncTask(uri);


gdbTask.Token = token; // pregenerated longterm token

GenerateGeodatabaseResult r = await gdbTask.SyncGeodatabaseAsync(taskParameters, gdb, syncCompleteCallback, null, new TimeSpan(0, 0, 3), progress, cancelToken);


I have tried this in both runtime 10.2.5 & 10.2.6.  (ArcGIS Server 10.22)