Kelsey Ciarrocca
Kelsey Ciarrocca

Reputation: 11

AGOL python web-tier authentication secured with PKI/CAC

I am using a python script to connect to an AGOL feature service layer, and update the layer. Right now, I use the following to access it:

gis_url = "https://xxxx.maps.arcgis.com"        #### Add your username and password
gis_username = 'username'
gis_password = 'password'
gis = arcgis.gis.GIS(gis_url, gis_username,gis_password)

However, I'd like to run this in our DoD AGOL Portal space, which is CAC enabled. I'm fairly new to this. Upon some research I came across this in an ESRI training,

print('n\n\nPKI with key and cert files")
gis = GIS("https://portalname.domain.com/webcontext",
          key file="C:\\Path\\to\\key.pem",
          cert_file="C:\\path\\to\\cert.pem")

Could it really be this easy? I looked up the "key.pem" and "cert.pem" on my computer, and there are several of these files. How do I know which one I'm supposed to use? Thank you in advance!

Upvotes: 1

Views: 142

Answers (0)

Related Questions