Select to view content in your preferred language

Why my Portal for ArcGIS admin credentials are not accepted when using API?

779
2
10-10-2023 09:33 AM
Labels (2)
TZ
by
Emerging Contributor

I am a new user and i'm trying to programmatically interact with Portal for ArcGIS and also ArcGIS server using my admin credentials.

My Windows user account name.surname@company.com has an Admin role and I have confirmed that i am able to login to https://company.server.com/portal/portaladmin/ via web-browser. 

However, when i attempt to authenticate myself via Python code, get errors like "Admin credentials not accepted.", "Exception: Access not allowed request", "(Error Code: 403)".

Please note that when i am using a generated token instead of my admin credentials, i do get Response 200 and the requested data.

So why can't i authenticate with my admin credentials?

I am using ArcGIS Enterprise v11.1

My code looks like this (i also tried various variations, like not providing username & password or using built-in/shared admin credentials):

 

from arcgis.gis import GIS


portal_url = 'https://company.server.com/portal/portaladmin/'
username = 'admin'
password = 'Pass1#'

try:

gis = GIS(portal_url, username, password)

print("Admin credentials accepted. Success!")


except Exception as e:

print(f"Admin credentials not accepted. Error: {str(e)}")

Tags (3)
0 Kudos
2 Replies
EarlMedina
Esri Regular Contributor

I think we need more information about your authentication scheme to provide any insights. You mention using a Windows account - are you using IWA, portal tier with AD, something else?

0 Kudos
TZ
by
Emerging Contributor

yes, i am using IWA - i login to all apps via SSO, including ArcGIS Enterprise

0 Kudos