Unable to protect credentials by storing them locally for a standalone ArcGIS Server

1113
3
Jump to solution
11-05-2019 09:38 AM
Subu_Swaminathan_GISP
New Contributor III

Unable to protect credentials by storing them locally for a standalone ArcGIS Server as per instructions at

Working with different authentication schemes | ArcGIS for Developers 

"""
The following snippet to create a profile DOES NOT WORK FOR STANDALONE ARCGIS SERVER

https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#Storing-your-credentials-locally
"""

from arcgis.gis import GIS

server_gis = GIS(url="https://server.com:6443/arcgis", username='AGS_user',
                    password='khjdfksjdfklj',profile='AGS_user')
print("profile defined for {}".format(server_gis))

Is there a way to create profiles for standalone ArcGIS Server authentication using ArcGIS API for Python? we are not using portal.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
HåkonDreyer
Esri Contributor

In the meantime, I Would recommend you use keyring, it is installed with the arcgis API so its readily available.

The password is stored in Windows credentials manager and you will find them there besides the passwords from profiles.

There are two easy steps, store your password:

Create key

And to use the password:

Use key

I prefer to use the Group name to discern between environments like Test and Prod.

View solution in original post

3 Replies
ImranKhan_P
New Contributor III

Hi Subramanian Swaminathan,

You can access stand-alone ArcGIS Servers that aren't part of a Portal using ArcGIS API for Python. But You cannot create profiles for standalone ArcGIS Server as in the case of connecting to a GIS Instance such as ArcGIS Online/ArcGIS Enterprise.

Server

The documentation which you have mentioned in here is meant for connecting to a GIS Instance.

In order to connect to a stand-alone ArcGIS Sever you can use the following snippet

from arcgis.gis.server import Server

test = Server(url="https://gis.mysite.com/arcgis/admin", GIS=None, username="xxxxx", password="yyyyyy", verify_cert=False)
‍

Connecting to a stand-alone server and accessing the list of services

For more information you can refer to the documentation arcgis.gis.server module

0 Kudos
Subu_Swaminathan_GISP
New Contributor III

Pattan Imran Khan‌ - Thanks for confirming that.

What would it take for ArcGIS API for Python team to bring this missing functionality for standalone ArcGIS Server administration? I am pretty sure there are a considerable number of esri users using standalone ArcGIS Server and would like to automate ArcGIS Server adminstration using this api and authenticate in a more secure process.

0 Kudos
HåkonDreyer
Esri Contributor

In the meantime, I Would recommend you use keyring, it is installed with the arcgis API so its readily available.

The password is stored in Windows credentials manager and you will find them there besides the passwords from profiles.

There are two easy steps, store your password:

Create key

And to use the password:

Use key

I prefer to use the Group name to discern between environments like Test and Prod.