<?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: API Key Lifetime functionality - Giving different keys within the Lifetime period itself. in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/445255#M2827</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/167879"&gt;@ArunkumarDurais&lt;/a&gt;,&amp;nbsp;I don't believe there is a way to see generated keys (which is not uncommon for API keys in various systems), hence whatever system does the keygen needs to store the key, for the lifetime it is valid per your config. I would run the keygen manually with the API command you quoted at the start of this thread, then use it a few minutes later for a simple info query API command e.g.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://{{host}}/api?key={{key}}&amp;amp;type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;system&amp;gt;&amp;lt;info/&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/show&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;It should work, and should work at 19 minutes, and should then stop working by 21 minutes (if you have lifetime set to 20 minutes.) That should prove that PAN-OS is working correctly; if that fails, open a TAC case. It if works, something Firemon is doing is not correct. Hope that helps?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Nov 2021 15:01:20 GMT</pubDate>
    <dc:creator>JimmyHolland</dc:creator>
    <dc:date>2021-11-03T15:01:20Z</dc:date>
    <item>
      <title>API Key Lifetime functionality - Giving different keys within the Lifetime period itself.</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/443855#M2817</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have API Key Lifetime configured to 20 mins. But if we are trying to get the API key within 5 mins gap (for example) it is giving different keys. Kindly help me to understand this function. I am trying to view the keys using the below URL, its giving the different keys but always first few and last few string are same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://%3chostname%3e/api/?type=keygen&amp;amp;user=%3cusername%3e&amp;amp;password=%3cpassword%3e" target="_blank"&gt;https://&amp;lt;hostname&amp;gt;/api/?type=keygen&amp;amp;user=&amp;lt;username&amp;gt;&amp;amp;password=&amp;lt;password&amp;gt;.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 17:25:05 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/443855#M2817</guid>
      <dc:creator>ArunkumarDurais</dc:creator>
      <dc:date>2021-10-27T17:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: API Key Lifetime functionality - Giving different keys within the Lifetime period itself.</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/445215#M2824</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/167879"&gt;@ArunkumarDurais&lt;/a&gt;,&amp;nbsp;that API command is a "keygen" command, for API key generation. Every time you call it, you generate a new key, so this is expected behaviour. If you have already done a keygen command, I would suggest to store the key in a variable (in whatever language/script/tool you are using) so that you can reuse it for the next 19 minutes. Hope that helps...&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 12:40:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/445215#M2824</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2021-11-03T12:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: API Key Lifetime functionality - Giving different keys within the Lifetime period itself.</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/445229#M2826</link>
      <description>&lt;P&gt;Hi JimmyHolland,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the update, even i suspected the same. Is there any way to see the current key in the firewall using any API command without any external scripts.&lt;/P&gt;&lt;P&gt;We have a compliant for Firemon integration that the firewall is rejecting the connection even if the Firemon is presenting same key within the API Key lifetime. So we are trying to confirm whether the firewall is holding the same within the Key lifetime period or not.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 13:56:35 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/445229#M2826</guid>
      <dc:creator>ArunkumarDurais</dc:creator>
      <dc:date>2021-11-03T13:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: API Key Lifetime functionality - Giving different keys within the Lifetime period itself.</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/445255#M2827</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/167879"&gt;@ArunkumarDurais&lt;/a&gt;,&amp;nbsp;I don't believe there is a way to see generated keys (which is not uncommon for API keys in various systems), hence whatever system does the keygen needs to store the key, for the lifetime it is valid per your config. I would run the keygen manually with the API command you quoted at the start of this thread, then use it a few minutes later for a simple info query API command e.g.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://{{host}}/api?key={{key}}&amp;amp;type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;system&amp;gt;&amp;lt;info/&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/show&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;It should work, and should work at 19 minutes, and should then stop working by 21 minutes (if you have lifetime set to 20 minutes.) That should prove that PAN-OS is working correctly; if that fails, open a TAC case. It if works, something Firemon is doing is not correct. Hope that helps?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 15:01:20 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/445255#M2827</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2021-11-03T15:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: API Key Lifetime functionality - Giving different keys within the Lifetime period itself.</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/450942#M2840</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/167879"&gt;@ArunkumarDurais&lt;/a&gt;&amp;nbsp;There is a bit of misconception about how the API keys work on firewalls/Panorama.&lt;/P&gt;&lt;P&gt;The keys are not "generated" and thus not saved.&amp;nbsp;The key a hash function of the account username, password and time/date of generation (and this is the reason you get different key every time).&lt;/P&gt;&lt;P&gt;The key lifetime was introduced in PanOS9. Before 9, the API key was only a function of the username and password and you used to get the same every time you "generate" it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So when you send the key to firewall, it user its algorithm to convert it to the date/time of generation, username and password. If the time is within you API configured lifetime, then the username and password will be used for authentication. If not or if you changed the password, then authentication will fail.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 13:09:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-key-lifetime-functionality-giving-different-keys-within-the/m-p/450942#M2840</guid>
      <dc:creator>batd2</dc:creator>
      <dc:date>2021-12-02T13:09:56Z</dc:date>
    </item>
  </channel>
</rss>

