<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: REST API to ISE server to close down existing connection? in Network Access Control</title>
    <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088661#M560511</link>
    <description>&lt;P&gt;Thanks Mike.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought, after the 1st client.get, the connection is closed. Then, the 2nd client.get should return something other than 200.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thought?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;client.headers['Connection'] = 'close'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;client.headers['authorization'] = 'xyz'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;response = client.get(client.url)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;response = client.get(client.url)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 May 2020 13:57:00 GMT</pubDate>
    <dc:creator>pn2020</dc:creator>
    <dc:date>2020-05-19T13:57:00Z</dc:date>
    <item>
      <title>REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088372#M560492</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Is it possible to send a REST API request to the ISE server to logout the current session?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;client = requests.session()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;response=client.get(url, headers=headers, verify=False)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 01:48:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088372#M560492</guid>
      <dc:creator>pn2020</dc:creator>
      <dc:date>2020-05-19T01:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088655#M560509</link>
      <description>Have you tried adding 'connection': 'close' to your HEADERS? I think that may do the trick.  If not try this:&lt;BR /&gt;conn = requests.session()&lt;BR /&gt;conn.config['keep_alive'] = False&lt;BR /&gt;HTH!</description>
      <pubDate>Tue, 19 May 2020 13:54:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088655#M560509</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2020-05-19T13:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088661#M560511</link>
      <description>&lt;P&gt;Thanks Mike.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought, after the 1st client.get, the connection is closed. Then, the 2nd client.get should return something other than 200.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thought?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;client.headers['Connection'] = 'close'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;client.headers['authorization'] = 'xyz'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;response = client.get(client.url)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;response = client.get(client.url)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 13:57:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088661#M560511</guid>
      <dc:creator>pn2020</dc:creator>
      <dc:date>2020-05-19T13:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088697#M560512</link>
      <description>AFAIK since you are initiating multiple GET requests they will be successful since you are initiating a new request (obviously given that the code works as expected).  Try printing the response in between the two requests to see the differences in the sessions.</description>
      <pubDate>Tue, 19 May 2020 14:43:46 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088697#M560512</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2020-05-19T14:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088950#M560523</link>
      <description>The response.content are exactly the same.</description>
      <pubDate>Tue, 19 May 2020 22:37:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4088950#M560523</guid>
      <dc:creator>pn2020</dc:creator>
      <dc:date>2020-05-19T22:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4089014#M560526</link>
      <description>AFAIK you should be able to close the connection via setting it in your headers OR via closing it on client side once the request is done.  Try printing the returned headers from the server after you send your request to ensure you have properly set the connection to close via your request header:&lt;BR /&gt;response = client.get(client.url)&lt;BR /&gt;print response.headers&lt;BR /&gt;&lt;BR /&gt;Or test it via:&lt;BR /&gt;response = client.get(client.url)&lt;BR /&gt;response.close()</description>
      <pubDate>Wed, 20 May 2020 01:11:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4089014#M560526</guid>
      <dc:creator>Mike.Cifelli</dc:creator>
      <dc:date>2020-05-20T01:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4089016#M560528</link>
      <description>&lt;P&gt;Thanks Mike!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the following.&amp;nbsp; What I found out is that, the first 2 prints of the headers produce the same information.&amp;nbsp; The 2nd&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;client.get(url) gets the same result/data as the 1st&amp;nbsp;client.get(url).&amp;nbsp; So, that means, the resp.close() doesn't seem to close down the connection.&amp;nbsp; If it did, the 2nd&amp;nbsp;client.get(url) wouldn't return the valid device data from ISE server.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind of strange.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resp&amp;nbsp;=&amp;nbsp;client.get(url)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(resp.headers)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resp.close()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(resp.headers)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resp&amp;nbsp;=&amp;nbsp;client.get(url)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print (resp.text)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 May 2020 02:27:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4089016#M560528</guid>
      <dc:creator>pn2020</dc:creator>
      <dc:date>2020-05-20T02:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: REST API to ISE server to close down existing connection?</title>
      <link>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4096499#M560852</link>
      <description>&lt;P&gt;If I don't do a session close (either via &lt;SPAN&gt;resp.close(), or headers['connection'] = 'close')&lt;/SPAN&gt;, is there a session timeout timer set on the ISE server that will eventually tear down the session (from the client)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 22:31:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-access-control/rest-api-to-ise-server-to-close-down-existing-connection/m-p/4096499#M560852</guid>
      <dc:creator>pn2020</dc:creator>
      <dc:date>2020-06-02T22:31:42Z</dc:date>
    </item>
  </channel>
</rss>

