<?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: How to check if the restapi token is valid in PAM Self-Hosted Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374870#M60628</link>
    <description>&lt;P&gt;As far as DAP: My understanding is as follows but I'm not sure.. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generally, login API services will return the response as JSON body. There should be a Date field (ex: Date:"Fri, 18 Jun 2021 08:15:44 GMT"). I've taken this Date from DAP Access Token and this will be valid for 8 minutes.. And this will be automatically refreshed if there is any subsequent request within these 8 minutes time frames.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jun 2021 08:50:03 GMT</pubDate>
    <dc:creator>CyberArkAlumni</dc:creator>
    <dc:date>2021-06-18T08:50:03Z</dc:date>
    <item>
      <title>How to check if the restapi token is valid</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374869#M60627</link>
      <description />
      <pubDate>Fri, 18 Jun 2021 07:18:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374869#M60627</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2021-06-18T07:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if the restapi token is valid</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374870#M60628</link>
      <description>&lt;P&gt;As far as DAP: My understanding is as follows but I'm not sure.. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generally, login API services will return the response as JSON body. There should be a Date field (ex: Date:"Fri, 18 Jun 2021 08:15:44 GMT"). I've taken this Date from DAP Access Token and this will be valid for 8 minutes.. And this will be automatically refreshed if there is any subsequent request within these 8 minutes time frames.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 08:50:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374870#M60628</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2021-06-18T08:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if the restapi token is valid</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374871#M60629</link>
      <description>&lt;P&gt;I am using cyberark login as auth method and  just get the session token ,no other info.&lt;/P&gt;&lt;P&gt;I want to make an api call to see if the token is valid &lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 09:14:34 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374871#M60629</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2021-06-18T09:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if the restapi token is valid</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374872#M60630</link>
      <description>&lt;P&gt;You can send a GET request using the token to one of the below endpoints:&lt;/P&gt;&lt;CODE&gt;/api/LoginsInfo
/WebServices/PIMServices.svc/User
/WebServices/PIMServices.svc/Server&lt;/CODE&gt;&lt;UL&gt;&lt;LI&gt;&lt;A alt="https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/SDK/User%20Web%20Services%20-%20Logged%20on%20User%20Details.htm" href="https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/SDK/User%20Web%20Services%20-%20Logged%20on%20User%20Details.htm" target="_blank"&gt;Get logged on user details | CyberArk Docs&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A alt="https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/SDK/Server%20Web%20Services%20-%20Server.htm" href="https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/SDK/Server%20Web%20Services%20-%20Server.htm" target="_blank"&gt;Server | CyberArk Docs&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 18 Jun 2021 16:10:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374872#M60630</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2021-06-18T16:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if the restapi token is valid</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374873#M60631</link>
      <description>&lt;P&gt;You could do this in powershell. Just replace baseURL,username,password. It should do the task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$URL_CyberArkLogon = "https://&amp;lt;baseURL&amp;gt;/passwordvault/api/auth/cyberark/Logon"&lt;/P&gt;&lt;P&gt;$logonBody = @{ username=&amp;lt;$rstusername&amp;gt;;password=&amp;lt;$rstpassword&amp;gt; }&lt;/P&gt;&lt;P&gt;$logonToken&amp;nbsp;= ""&lt;/P&gt;&lt;P&gt;$logonBody = $logonBody | ConvertTo-Json&lt;/P&gt;&lt;P&gt;$URL_CyberArkLogoff = "https://&amp;lt;baseURL&amp;gt;/passwordvault/api/auth/Logoff"&lt;/P&gt;&lt;P&gt;$logonHeader =&amp;nbsp;New-Object "System.Collections.Generic.Dictionary[[String],[String]]"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;try{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;# Logon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$logonToken = Invoke-RestMethod -Method Post -Uri $URL_CyberArkLogon -Body $logonBody -ContentType "application/json"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;catch&lt;/P&gt;&lt;P&gt;	{&lt;/P&gt;&lt;P&gt;		Write-Host -ForegroundColor Red $_.Exception.Response.StatusDescription&lt;/P&gt;&lt;P&gt;		$logonToken = ""&lt;/P&gt;&lt;P&gt;	}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;If ($logonToken -eq "")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Write-Host -ForegroundColor Red "Logon Token is Empty - Cannot login"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;else&lt;/P&gt;&lt;P&gt;	{write-host "Token value: $logontoken"}&lt;/P&gt;&lt;P&gt;$logonHeader.Add("Authorization", $logonToken)&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 17:49:37 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/how-to-check-if-the-restapi-token-is-valid/m-p/1374873#M60631</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2021-06-22T17:49:37Z</dc:date>
    </item>
  </channel>
</rss>

