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-authentication-with-OAuth-2.0
Here is my entire code:
---------------------------------------------------------
from arcgis.gis import GIS
username = 'portaladmin'
password = 'pasw1234'
print("Portal for ArcGIS as a built in user")
gis = GIS(portal_url, username, password)
print("Logged in as: " + gis.properties.user.username)
------------------------------------------------
i get this error:
Exception: Unable to generate oauth token
How to solve this? Do i have to register this simple script as an App in Azure AD or something?