Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

SSL required error message #132

Closed yinshi closed 8 years ago

yinshi commented 8 years ago

Thanks for creating ArcRest. It is really useful. Could you please help me troubleshoot a security problem I have ran into?

After turning on 'Allow access to the organization through HTTPS only' under Security in AGOL, I am no longer able to be authenticated by AGOL. I got the following error: {u'message': u'SSL Required', u'code': 403, u'details': [u'SSL Required']}

How do I rework my code to get this working? Should I change security_type?

Here is a portion of my code: securityinfo = {} securityinfo['security_type'] = 'Portal'
securityinfo['username'] = "xxx" securityinfo['password'] = "xxx" securityinfo['org_url'] = "https://www.arcgis.com" securityinfo['certificatefile'] = None shh = securityhandlerhelper.securityhandlerhelper(securityinfo) sourceFeatureLayer = FeatureLayer(url='xxx', securityHandler=shh, proxy_port=None, proxy_url=None, initialize=True)

achapkowski commented 8 years ago

Are you using HTTPS in your service URL?

yinshi commented 8 years ago

Thanks for the tip. That was the problem. The script works now with using HTTPS in the service URLs.

achapkowski commented 8 years ago

great