Select to view content in your preferred language

Multifactor Auth in AGOL & the Python API

1017
2
09-30-2019 10:26 AM
GregMcNamee
New Contributor III

Is there no way to create GIS object connecting to an ArcGIS Online org, using the credentials of a user that has multi-factor authentication enabled? Our org requires administrators to use multi-factor authentication, but I can't find a way to log in to the org via the Python API. I keep getting this error:

If there's not a way to do it, is there a plan to add a mechanism to do so?

Greg McNamee
2 Replies
JeroenBaltussen1
New Contributor II

Hoi,

This issues is also very relevant for our organisation.

Do you maybe have an update for this item.

Jeroen Baltussen

Jonathan_Goergen
New Contributor III

I cannot run scripts to AGOL and I suspect MFA is the issue.  Are there ways to utilize scripts with MFA implemented?  I use to use scripts like below to access REST services, and generate tokens for the irritating "Token Required" message at REST endpoints for services I published while I am online:

Jonathan_Goergen_0-1714668766937.png

 

params = {'f': 'pjson', 'username': userName, 'password': pw, 'referer': 'https://www.arcgis.com', 'expiration': 21600}
tokenURL = 'https://www.arcgis.com/sharing/rest/generateToken'
response = requests.post(tokenURL, data = params, verify = False)
token = response.json()['token']

0 Kudos