05-18-2020 06:48 PM
Is it possible to send a REST API request to the ISE server to logout the current session?
Let's say, I am using this in python After the get, I want to close down the session gracefully. session.close() doesn't seem to close the session down.
Thanks.
client = requests.session()
response=client.get(url, headers=headers, verify=False)
Solved! Go to Solution.
05-19-2020 06:11 PM
05-19-2020 06:54 AM
05-19-2020 06:57 AM
Thanks Mike.
I tested the below, but it's weird that the 2nd request.get's response.status_code is still 200. I intentionally messed up the credential too, with 'xyz'. Since the connection is closed by then, I was expecting some type of error, not 200.
I thought, after the 1st client.get, the connection is closed. Then, the 2nd client.get should return something other than 200.
Thought?
client.headers['Connection'] = 'close'
client.headers['authorization'] = 'xyz'
response = client.get(client.url)
response = client.get(client.url)
05-19-2020 07:43 AM
05-19-2020 03:37 PM
05-19-2020 06:11 PM
05-19-2020 06:17 PM - edited 05-19-2020 07:27 PM
Thanks Mike!
I did the following. What I found out is that, the first 2 prints of the headers produce the same information. The 2nd client.get(url) gets the same result/data as the 1st client.get(url). So, that means, the resp.close() doesn't seem to close down the connection. If it did, the 2nd client.get(url) wouldn't return the valid device data from ISE server.
Kind of strange.
06-02-2020 03:23 PM - edited 06-02-2020 03:31 PM
If I don't do a session close (either via resp.close(), or headers['connection'] = 'close'), is there a session timeout timer set on the ISE server that will eventually tear down the session (from the client)?
Or the question really is, is there a session timeout timer set on the ISE server to tear the session down, if the session stays idle too long?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide