I must be missing something. I need to query a secured AGOL hosted feature service but I can't figure out how to turn the feature layer into a table using credentials. Does anyone have a simple snippet on how to do this?
That works. Thanks!!!!
You can create a ServiceFeatureTable and set the credentials property and then load the table. Please refer to code snippet below.
var creds = await AuthenticationManager.Current.GenerateCredentialAsync(new Uri(@"http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire_secure/FeatureServer/0"),"user1","user1"); var ft = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire_secure/FeatureServer/0")); ft.Credential = creds; await ft.LoadAsync();
Retrieving data ...