cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
640
Views
0
Helpful
1
Replies

API authentication failed with consecutive logins

Meng Li
Level 1
Level 1

HI everyone,

 

I had some test python script to do API authentication, which worked fine in vManage 19.2, recently we got the vManage upgraded to 20.x, now what I've found is if I run the script consecutively within a short period of time, the first login will be successful, then all other login attempt will failed. But if I wait long enough (i.e., 5 minutes or longer) and run the script again, then it will be authenticated successfully again showing 'login successful'.

 

My script is as simple as the example given in the Devnet:

 

sess = requests.session()

 

login_response = sess.post(url=login_url, data=login_data, verify=False, proxies=https_proxy)

 

if b'<html>' in login_response.content:
print ("Login Failed")

else:
print ('Login successful!\n')

 

I'm suspecting now with v20.x logout action is enforced before a further login attempt otherwise it needs a longer time before the session it timed out? My sample code does not include session logout. 

 

Has anyone tried on v20.x and had the similar experience?

 

1 Reply 1

Meng Li
Level 1
Level 1

Ok, the issue was sorted out. It worked after the admin changed my local login password. I can login without restrictions.

My credentials is part of a read-only group, not sure what was going wrong with it. It's all good now. 

 

Thanks all,