I am trying to Connect to ArcGIS Enterprise v11.1 using a built-in account as described in tutorial --> https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#User-authe...
Here is my entire code:
---------------------------------------------------------
Remove "portaladmin". It should be: "https://myserver.org/portal" from your example.
I changed the "portal_url" value to "https://myserver.org/portal" as per your suggestion but still get the same error "Unable to generate oauth token", the only difference being an informational message "Portal for ArcGIS as a built in user" in the output at the very beginning.
Are there any more guides regarding setting up OAuth for ArcGIS Python API aside this very scant page ? --> https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#User-authe...
and what about my previous question - do i have to register this modest script as an app in Azure AD or not??
Are you saying this is in fact not a built in user? Are you actually using Azure AD? DO you happen to know how the portal was sconfigured?
I started seeing this same issue that started yesterday. Do you have a solution or work-around? I've been using this calls in scripts for more than a year, no problem until now.
My proxy changed and that was what was causing this error. It is resolved now.
where are you specifying the proxy changes? I have a very similar issue, but I know nothing has changed....
I had a proxy in my browser settings. My employer stopped using that proxy though and it caused these errors. It was fine once I turned off the "Manual proxy setup" in Chrome. These days I use a profile to log in. You can set up in a notebook from Pro.
### Set up a profile
from arcgis.gis import GIS
gis_profile = GIS("https://subdomain.maps.arcgis.com", "un", "pw", profile="gisprof")
print("Profile defined for {}".format(gis_profile))
And then in my scripts I call:
mygis = GIS("https://subdomain.maps.arcgis.com", profile="gisprof")
print("Connected to the GIS as {}.".format(mygis.properties.user.username))
Does that work for you?
The only things I have seen work (dependent on your Pro version) are use_gen_token=True, which ignores oAuth and uses the built-in users you have.
However, this is the issue I am experiencing now, where it causes issues if its not added i.e. it won't login without use_gen_token, but then when trying to query a layer I get an invalid token.
The documentation is rather poor, and every pro upgrade, is a finger in the air as to whether your existing code will work 🙂