Error: json.decoder.JSONDecoderError:Expecting value: line 1 column 1
Error Message
Running an ArcGIS API for Python script that requires signing in to Portal for ArcGIS may fail and return the following error:
Error: json.decoder.JSONDecoderError:Expecting value: line 1 column 1

Cause
This error occurs when attempting to connect to Portal for ArcGIS using the domain name server (DNS) alias and the portal is authenticating through a web-tier authentication (IWA or SAML).
Solution or Workaround
To solve this issue, use the fully qualified domain name (FQDN) to connect to the portal.
gis = GIS("https://<machine.domain.com>:7443/arcgis", "username", "password", verify_cert = False)
Note: For portals authenticating through web-tier authentication, using the FQDN with port 7443 is the only workaround for this issue, and users are unable to use DNS within the script.

Related Information
- ArcGIS Enterprise: Domain name service (DNS) and fully qualified domain name (FQDN) requirements
- Portal for ArcGIS: Scripting with ArcGIS API for Python
Last Published: 8/5/2021
Article ID: 000024610
Software: ArcGIS API for Python 1.9, 1.8.5, 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.1, 1.7.0, 1.6.1, 1.6 Portal for ArcGIS 10.9, 10.8.1, 10.8, 10.7.1, 10.7, 10.6.1, 10.6