Best way to authenticate?

466
2
Jump to solution
11-09-2023 09:04 AM
CodyPatterson
Occasional Contributor III

Hey all,

Recently, I have started to need a Python Notebook to run every minute. This provides real time updating of submitted requests to a ticketing system that is directly involved with geolocation by Survey123.

The ArcGIS Notebook does not allow any scheduled tasks to operate on a minute frequency, so I planned to stage this on a server that would run this through task scheduler.

During my attempts to get this running on the server, I seem to have encountered an issue where I cannot log into the Portal, no matter the combination of my credentials. I would normally use:

GIS("https://portalname.domain.com/webadapter_name", "DOMAIN\\user.account", "password"

But I was met with "Invalid username or password" testing cases and combinations of uppercase and lowercase letters did not change anything.

Using this it was the same:

GIS("https://portalname.domain.com/webadapter_name", "sharing1", "password")

I ended up attempting with Oauth2 and I would much rather not enter an authentication key every single minute, GET requests did not prove viable in ways of getting the oauth key.

How should I proceed with automation and  authenticate with my portal when ('home') is not able to be used?

 

Thank you in advance!

0 Kudos
1 Solution

Accepted Solutions
JamesCrandall
MVP Frequent Contributor

Sounds like your portal is connected to your active directory accounts maybe?  If that's the case, what we do is create a new portal account that doesn't use AD to authenticate and this is the account used for authentication within any scripting.

 

Also: if you have ArcGIS Pro open and you are logged into the portal, does your script run successfully then to create the GIS object?

View solution in original post

0 Kudos
2 Replies
JamesCrandall
MVP Frequent Contributor

Sounds like your portal is connected to your active directory accounts maybe?  If that's the case, what we do is create a new portal account that doesn't use AD to authenticate and this is the account used for authentication within any scripting.

 

Also: if you have ArcGIS Pro open and you are logged into the portal, does your script run successfully then to create the GIS object?

0 Kudos
CodyPatterson
Occasional Contributor III

Thank you for the reply James,

I believe that may be the best way to go, you are correct in the AD sync, just wanted to confirm before we purchased another creator account and made the user.

I appreciate the response and I believe that solves it!