VMANAGE REST API AUTHENTICATION TO GET COOKIE SESSION
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 07:07 AM
Hello Guys
Please I am getting an error running the program from the Cisco Devnet repository "https://github.com/CiscoDevNet/Getting-started-with-Cisco-SD-WAN-REST-APIs" . Am getting the error below when I run the script against my production VMANAGE
However the program works fine when I run it against the sandbox Vmanage on developer.cisco
I'm running vmanage version 19.2.4 in production
And the code below is from the original sdwan.py script that is giving the said error.
Can anyone help please
- Labels:
-
Other Networking Topics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 01:28 PM
Hi @BlackAvatar,
It might be just a problem with pasting your code, but it seems you're missing an ending parentheses at the end of the 'get_jsessionid' function, after the last parameter.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2022 01:52 AM
@BlackAvatar it works on the sandbox as this is using the new version of auth, which was released.
You would need something like for older version auth.
import requests
login_url = 'https://[ipaddress]:8443/j_security_check'
login_credentials = {'j_username':'[username]', 'j_password':'[password]'}
session = requests.session()
response = session.post(url=login_url, data=login_credentials, verify=False)
if b'<html>' in response.content:
print('Login Failed')
else:
print('Login Success')
Hope this helps.
Connect with me https://bigevilbeard.github.io
