GeodatabaseSyncTask with Credentials (like Android API)

576
1
Jump to solution
08-30-2016 11:06 AM
TércyoStorck1
New Contributor III

Hi,

I want to know if .NET API allows me to send credentials just like the Android API.

When I create an instance of a GeodatabaseSyncTask on Android, we may pass the crendentials to GeodatabaseSyncTask, like this:

GeodatabaseSyncTask gdbSyncTask = new GeodatabaseSyncTask(url, userCredentials)

But in .NET API it just gives me the option of the token type authentication. I really need to send credentials (username and password) to authenticate on ArcGisServer

0 Kudos
1 Solution

Accepted Solutions
TércyoStorck1
New Contributor III

I found the answer whith a Antti Kajanus‌ help.

System.Net.NetworkCredential networkCredential = new System.Net.NetworkCredential(userName, passWord, domain);

var credential = new ArcGISNetworkCredential
{
   Credentials = networkCredential,
   ServiceUri = this.featureService.Url
};

IdentityManager.Current.AddCredential(credential);

View solution in original post

0 Kudos
1 Reply
TércyoStorck1
New Contributor III

I found the answer whith a Antti Kajanus‌ help.

System.Net.NetworkCredential networkCredential = new System.Net.NetworkCredential(userName, passWord, domain);

var credential = new ArcGISNetworkCredential
{
   Credentials = networkCredential,
   ServiceUri = this.featureService.Url
};

IdentityManager.Current.AddCredential(credential);
0 Kudos