Select to view content in your preferred language

Multifactor Auth in AGOL & the Python API

09-30-2019 10:26 AM
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
New Contributor II


This issues is also very relevant for our organisation.

Do you maybe have an update for this item.

Jeroen Baltussen

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:



params = {'f': 'pjson', 'username': userName, 'password': pw, 'referer': '', 'expiration': 21600}
tokenURL = ''
response =, data = params, verify = False)
token = response.json()['token']

0 Kudos