Using cursor to update Hosted Feature Service without login

281
5
Jump to solution
12-20-2021 11:10 AM
Boyang_Wang
Occasional Contributor II

Hi,

Has anyone tried to use ArcPy cursor to update Hosted Feature Service without login? Today I succeeded in using InsertCursor and UpdateCursor on a private hosted feature service using just the URL without logging in to my Enterprise Portal. Does this mean any person can access a private hosted feature service using ArcPy cursor?

Boyang

UPDATE: After testing I confirmed that, without logging to a portal in ArcGIS Pro, I can only edit public features with editing enabled. This conforms to ArcGIS security rules. False alarm.

0 Kudos
2 Solutions

Accepted Solutions
jcarlson
MVP Frequent Contributor

If you're using arcpy, you are being authenticated with your organization's portal already in order to check out a license, so I don't think it means anonymous users can edit things.

I could give you a throwaway private feature service URL from a different org if you wanted to test that.

- Josh Carlson
Kendall County GIS

View solution in original post

jcarlson
MVP Frequent Contributor

Okay! Here's the URL: https://services6.arcgis.com/U1zX3Wx8hhY7Gb30/arcgis/rest/services/Scratch/FeatureServer/2

There are about 13 random polygons I added. See if anything happens!

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
5 Replies
jcarlson
MVP Frequent Contributor

If you're using arcpy, you are being authenticated with your organization's portal already in order to check out a license, so I don't think it means anonymous users can edit things.

I could give you a throwaway private feature service URL from a different org if you wanted to test that.

- Josh Carlson
Kendall County GIS
Boyang_Wang
Occasional Contributor II

Hi Josh,

Yes I would like to try that out - whether I can use UpdateCursor to delete all features in one of your throwaway private service via URL.

Thanks,

Boyang

0 Kudos
jcarlson
MVP Frequent Contributor

Okay! Here's the URL: https://services6.arcgis.com/U1zX3Wx8hhY7Gb30/arcgis/rest/services/Scratch/FeatureServer/2

There are about 13 random polygons I added. See if anything happens!

- Josh Carlson
Kendall County GIS
0 Kudos
Boyang_Wang
Occasional Contributor II

I got an error:

RuntimeError: cannot open 'https://services6.arcgis.com/U1zX3Wx8hhY7Gb30/arcgis/rest/services/Scratch/FeatureServer/2'

You are absolutely right that my Portal login info is stored in arcpy even though I don't have ArcGIS Pro opened (I ran the script in Anaconda) or portal logged in. If I manually log out my account in ArcGIS Pro, I can't access my own private feature service via cursor. Thanks!

0 Kudos
DanPatterson
MVP Esteemed Contributor
0 Kudos