Login to AGOL using enterprise login with python

1922
3
03-03-2020 04:53 AM
by Anonymous User
Not applicable

Hello all, 

I went through this link in an effort to successfully login to AGOL using my enterprise account however, I am continually faced with invalid credentials error. The authorization to my enterprise account is windows authentications and hence I used my windows password. I am still unsuccessful. Any pointers would help!

When I use a built-in account, I am able to login successfully

from arcgis.gis import GIS

insPortal = GIS("portal-link", username = 'AGOL_uname', password = 'password')
print("Logged in as: " + str(insPortal.properties))
print('Login Succesful')
Tags (1)
3 Replies
BenTurrell
Occasional Contributor III

Hey @Sravanthi Murali,

First thing you can try is changing the part in red to

https://www.arcgis.com

insPortal = GIS("portal-link", username = 'AGOL_uname', password = 'password')

Try that and let me know how it goes!

Thanks,

Ben


If this answer has helpful please mark it as helpful. If this answer solved your question please mark it as the answer to help others who have the same question.

by Anonymous User
Not applicable

Hello Ben, 

Thank you for the pointer. Unfortunately, it does not go through

I used a workaround by logging into AGOL using ArcGIS Pro and called my python script to get access from there.

I used the following

gis = GIS('pro')

AdrianHughes2
New Contributor II

using Pro to log in is a neat trick 

0 Kudos