Pass AD Login from arcgis to arcpy

871
3
01-23-2020 01:20 PM
TedCronin
MVP Honored Contributor

Is there a way to pass my AD login from arcgis to arcpy?  The arcpy package only supports built in accounts, and I want to only have 1 account per each of my users in enterprise/agol.  Currently, have built in for running arcpy, and for arcgis can use either enterprise login or a built in with arcgis.  For a lot of my tasks, I only need arcpy, but wish to utilize the enterprise login support from arcgis.

3 Replies
TrevorNickolai
New Contributor III

Hey Ted,

It is possible to do what you seek.  This document can help with getting your Python API set to utilize authentication methods other than built-in: Working with different authentication schemes | ArcGIS for Developers 

OAuth2.0 = Enterprise Logins/SAML.  I hope the documentation is helpful for you.

0 Kudos
TedCronin
MVP Honored Contributor

The doc is using the arcgis api with other authentication methods, I want to pass that arcgis login to arcpy and use arcpy in my work, not use arcgis.  I am just wanting to use the AD login from arcgis, since arcpy does not have a way to use AD accounts to authorize.  

0 Kudos
WengNg2
New Contributor III

Hi,

I'm experiencing the same issue. There is no support for Enterprise login using OAuth2.0 via ArcPy. 

We use Arcpy to overwrite feature layers to automate the refresh but because it doesn't support Enterprise Login via ArcPy, I need to sign in manually and check the 'Sign In Automatically' option in ArcGIS Pro.

However, for whatever reason, sometimes the user gets signed out of ArcGIS Pro which causes the script to break. 

Would be great if there is an option for me to pass a token of some sort through ArcPy.

arcpy.SignInToPortal(arcpy.GetActivePortalURL(),token='')

 

0 Kudos