<?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: Authenticating to the geoevent admin api in ArcGIS GeoEvent Server Questions</title>
    <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/authenticating-to-the-geoevent-admin-api/m-p/31234#M109</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, this suggestion was in a comment, I thought I had already tried this but I guess I did it wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the token request URL from&lt;BR /&gt;&lt;A class="unlinked"&gt;https://myserver.org:6443/arcgis/admin/generateToken&lt;/A&gt;&lt;BR /&gt;to&lt;/P&gt;&lt;P&gt;&lt;A class="unlinked"&gt;https://myserver.org:6443/arcgis&lt;/A&gt;/tokens&lt;BR /&gt;Worked. Which makes me feel dumb because that's the URL I hit in my browser for manually viewing API results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; color: #385723; background: #E2EFD9;"&gt;See Also:&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; color: #385723;"&gt;&amp;nbsp; Using the GeoEvent Admin API with Python&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-13489-using-the-geoevent-admin-api-with-python"&gt;https://community.esri.com/docs/DOC-13489-using-the-geoevent-admin-api-with-python&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Nov 2019 16:27:32 GMT</pubDate>
    <dc:creator>RolandMacDavid</dc:creator>
    <dc:date>2019-11-15T16:27:32Z</dc:date>
    <item>
      <title>Authenticating to the geoevent admin api</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/authenticating-to-the-geoevent-admin-api/m-p/31233#M108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm attempting to authenticate to and use the Admin Geoevent API, and I'm so far failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Documentation on usage is sparse without examples:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/geoevent/latest/administer/geoevent-server-rest-api-documentation.htm" title="https://enterprise.arcgis.com/en/geoevent/latest/administer/geoevent-server-rest-api-documentation.htm"&gt;GeoEvent Server REST API documentation—Administer(10.7.1) | ArcGIS Enterprise&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/geoevent/latest/administer/geoevent-server-administration.htm" title="https://enterprise.arcgis.com/en/geoevent/latest/administer/geoevent-server-administration.htm"&gt;GeoEvent Server administration—Administer(10.7.1) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Authenticating via browser works and I'm able to make API requests through there, but I want to perform this programmatically from a server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the steps to successfully using the admin API through the browser:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;Create a token here: &lt;A href="https://10.30.100.204:6143/geoevent/admin/" title="https://10.30.100.204:6143/geoevent/admin/"&gt;https://myserver.org:6443/arcgis/tokens&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Set the restriction to "Referrer URL" with a url of&amp;nbsp;&lt;A class="link-titled" href="https://{0}:6143/geoevent/admin" title="https://{0}:6143/geoevent/admin"&gt;https://myserver.org:6143/geoevent/admin&lt;/A&gt; .&lt;/LI&gt;&lt;LI&gt;Then pasting the provided token here gets it working in the browser: &lt;A href="https://10.30.100.204:6143/geoevent/admin/" title="https://10.30.100.204:6143/geoevent/admin/"&gt;https://myserver.org:6143/geoevent/admin/&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However doing it programmatically I am getting a 403 forbidden response. I've attempted to adapt one of the only examples of Geovent admin API authorization I've found. This example is strange as I've found no documentation anywhere about passing your API token in your HTTP headers as "GeoEventAuthorization": &lt;A href="https://community.esri.com/docs/DOC-13489"&gt;Using the GeoEvent Admin API with Python&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My own adaptation with small tweaks fails with a 403 forbidden error, as does the original: &lt;A class="link-titled" href="https://gist.github.com/floptical/2c973bd88532376567625703fe915e9c" title="https://gist.github.com/floptical/2c973bd88532376567625703fe915e9c"&gt;gist:2c973bd88532376567625703fe915e9c · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else successfully make Geoevent admin API calls?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2019 23:48:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/authenticating-to-the-geoevent-admin-api/m-p/31233#M108</guid>
      <dc:creator>RolandMacDavid</dc:creator>
      <dc:date>2019-11-14T23:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Authenticating to the geoevent admin api</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/authenticating-to-the-geoevent-admin-api/m-p/31234#M109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, this suggestion was in a comment, I thought I had already tried this but I guess I did it wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the token request URL from&lt;BR /&gt;&lt;A class="unlinked"&gt;https://myserver.org:6443/arcgis/admin/generateToken&lt;/A&gt;&lt;BR /&gt;to&lt;/P&gt;&lt;P&gt;&lt;A class="unlinked"&gt;https://myserver.org:6443/arcgis&lt;/A&gt;/tokens&lt;BR /&gt;Worked. Which makes me feel dumb because that's the URL I hit in my browser for manually viewing API results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; color: #385723; background: #E2EFD9;"&gt;See Also:&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; color: #385723;"&gt;&amp;nbsp; Using the GeoEvent Admin API with Python&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-13489-using-the-geoevent-admin-api-with-python"&gt;https://community.esri.com/docs/DOC-13489-using-the-geoevent-admin-api-with-python&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2019 16:27:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/authenticating-to-the-geoevent-admin-api/m-p/31234#M109</guid>
      <dc:creator>RolandMacDavid</dc:creator>
      <dc:date>2019-11-15T16:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Authenticating to the geoevent admin api</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/authenticating-to-the-geoevent-admin-api/m-p/1139455#M3714</link>
      <description>&lt;P&gt;Thanks for Posting!&lt;/P&gt;&lt;P&gt;I was running into a similar issue while trying to write a Python script to get the status' of all the GES services and sending an alert if any were encountering errors!&lt;/P&gt;&lt;P&gt;I changed the Token request (as you suggested) and also found out that I had to use the server's public URL as the referer! I could get a token using&amp;nbsp; 'requestip' as the 'client' value, but GES would not accept it.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def getToken ():
    url = 'https://&amp;lt;GES local URL&amp;gt;:6443/arcgis/tokens/'
    gesUn = '&amp;lt;GES UN&amp;gt;'
    gesPass = '&amp;lt;GES Pass&amp;gt;'

    params = {'username': gesUn, 'password': gesPass, 'client': 'client', 'referer': 'https://&amp;lt;GES Public URL&amp;gt;:6143/geoevent', 'f': 'pjson'}
    request = requests.post(url,data=params, verify=False)
    response = request.json()
    myToken = response["token"]
    return(myToken)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thanks Again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 17:30:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/authenticating-to-the-geoevent-admin-api/m-p/1139455#M3714</guid>
      <dc:creator>ChrisSchreiber</dc:creator>
      <dc:date>2022-02-01T17:30:59Z</dc:date>
    </item>
  </channel>
</rss>

