Web Tool Credentials

693
2
Jump to solution
03-16-2021 09:27 AM
MarkCederholm
Occasional Contributor III

我有一个web工具,使用arcpy和PythonAPI. The arcgis.gis.GIS object correctly sees the user of the web tool, but arcpy sees the owner of the ArcSOC process. I would like arcpy to sign into Portal as the web tool user [so that layers in a Pro project will be visible, which I don't want to share with Everyone]. Is there any way to do this?

Tags(3)
0Kudos
1 Solution

Accepted Solutions
MarkCederholm
Occasional Contributor III

I ended up creating a special account and storing the encrypted password. I'm not incredibly happy with that approach, but it at least prevents hard-coding credentials.

View solution in original post

0Kudos
2回答
nita14
by
Occasional Contributor III

Hi Mark,

As far as I know, you can not do it. You can try to create a 'proxy account' on your portal. Share the content with that user. Finally, hardcode/hash/upload from extrenal ressource its credentials in arcpy using:

https://desktop.arcgis.com/en/arcmap/10.7/tools/server-toolbox/sign-in-to-portal.htm

BR,

Adam

0Kudos
MarkCederholm
Occasional Contributor III

I ended up creating a special account and storing the encrypted password. I'm not incredibly happy with that approach, but it at least prevents hard-coding credentials.

0Kudos