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.
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.
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.
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.
Any update on this issue? I'd also like to leverage oauth/tokens for arcpy and I'm not seeing it in the documentation anywhere.
I think we're out of luck :
It is up to ESRI to provide a better auth mechanism in Arcpy for users using SAML.
You either use a built-in account of the sign-in manually via ArcGIS Pro.