laptop and a wrench

Bug

ArcGIS API for Python fails to authenticate with the following error message, "Exception: Unable to generate oauth token" returned when using built-in credentials and the Python environment in ArcGIS Server.

Portal for ArcGIS
Bug ID Number BUG-000160690
SubmittedAugust 16, 2023
Last ModifiedFebruary 14, 2025
Applies toPortal for ArcGIS
Version found11.1
Operating SystemWindows Server
Operating System Version2019 64 Bit
StatusWill Not Be Addressed

Additional Information

In ArcGIS Enterprise 11.x, administrators have the ability to disable the built-in Portal for ArcGIS account. If the SAML and built-in accounts are enabled, ArcGIS API for Python authenticates successfully. The other alternative is to use 'use_gen_token=True' with the built-in account information. ArcGIS API for Python does not support SAML logins.

Workaround

Edit the authentication line to include 'use_gen_token=True'.

For example: gis = GIS(portal_url, username, password, use_gen_token=True)

Steps to Reproduce

Bug ID: BUG-000160690

Software:

  • Portal for ArcGIS

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options