Hello,
When I try to create a GeodatabaseSyncTask with credentials it Always returns 401 unauthorized, even when the credentials are right. Here is the code that I'm using right now:
System<SPAN class="punctuation token">.</SPAN>Net<SPAN class="punctuation token">.</SPAN>NetworkCredential networkCredential <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">System<SPAN class="punctuation token">.</SPAN>Net<SPAN class="punctuation token">.</SPAN>NetworkCredential</SPAN><SPAN class="punctuation token">(</SPAN>userName<SPAN class="punctuation token">,</SPAN> passWord<SPAN class="punctuation token">,</SPAN> domain<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> credential <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGISNetworkCredential</SPAN>
<SPAN class="punctuation token">{</SPAN>
Credentials <SPAN class="operator token">=</SPAN> networkCredential<SPAN class="punctuation token">,</SPAN>
ServiceUri <SPAN class="operator token">=</SPAN> featureURI
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN>
GeodatabaseSyncTask gdbTask <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> GeodatabaseSyncTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateAsync</SPAN><SPAN class="punctuation token">(</SPAN>featureURI<SPAN class="punctuation token">,</SPAN> credential<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I don't know if my code is wrong, but I've tried it on iOS (API100.0) and old .NET api and it worked fine!