AnsweredAssumed Answered

Generate token from portal URL

Question asked by Magaly.Clement on Dec 11, 2017
Latest reply on May 3, 2018 by aug_aug

Hi,

 

Since I update arcgis 104.1 to 10.5.1, I have an issue when i want to generate token :

 

parameters = urllib.urlencode({'username' : username,
'password' : password,
'client' : 'referer',
'referer': portalUrl,
'expiration': 60,
'f' : 'json'})
response = urllib.urlopen(portalUrl + '/sharing/rest/generateToken?', parameters).read()
try:
jsonResponse = json.loads(response)
if 'token' in jsonResponse:
self.token = jsonResponse['token']
return self.token
elif 'error' in jsonResponse:
print(jsonResponse['error']['message'])
for detail in jsonResponse['error']['details']:
print(detail)
sys.exit(2)
except ValueError, e:
print('An unspecified error occurred.')
print(e)

 

IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

 

 

 

Do you have any idea to solve this issue ?

Thx.

Outcomes