DOI-BLM/requests-arcgis-auth

AGOL Mar 2019 Update: Broke SAML Auth - unable to parse response to obtain oAuthInf

Closed this issue · 0 comments

The Esri ArcGIS Online (AGOL) Mar 2019 update appears to have changed some javascript code within the OAuth2 login workflow 'authorize page' at https://ORG.maps.arcgis.com/sharing/oauth2/authorize


Existing code is erroring out with the following exception: 
Unable to obtain portal authorization information; unable to parse response to obtain oAuthInfo
Traceback (most recent call last):
  File "C:\tmp\code.py", line xxx, in main
    aaa.bbb()
   ...
	File "C:\tmp\requests\sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "C:\tmp\requests\sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "C:\tmp\requests\sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "C:\tmp\requests\models.py", line 317, in prepare
    self.prepare_auth(auth, url)
  File "C:\tmp\requests\models.py", line 548, in prepare_auth
    r = auth(self)
  File "C:\tmp\requests_arcgis_auth\arcgis_saml_auth.py", line 75, in __call__
    self._init(prepared_request.url)
  File "C:\tmp\requests_arcgis_auth\arcgis_saml_auth.py", line 101, in _init
    self._get_portal_authorization_info()
  File "C:\tmp\requests_arcgis_auth\arcgis_saml_auth.py", line 160, in _get_portal_authorization_info
    raise TokenAuthenticationError("{err}; unable to parse response to obtain oAuthInfo".format(err=ERROR_STRING))
TokenAuthenticationError: Unable to obtain portal authorization information; unable to parse response to obtain oAuthInfo

It appears the Esri authorize page was updated and the javascript code is failing the regular expression pattern match. Needs to be corrected to support the MAR 2019 update.