<?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>question Monitoring NiFi and 401 error api check in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Monitoring-NiFi-and-401-error-api-check/m-p/352151#M236449</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I've trying to monitoring nifi api. In our nifi we have configure oidc login and it works fine.&lt;/P&gt;&lt;P&gt;As monitoring, we using zabbix.&lt;/P&gt;&lt;P data-unlink="true"&gt;The problem in zabbix is when try to check api page (https://nificluster.info/nifi-api/flow/cluster/summary) and I receive http 401 error.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the web scenario monitoring, I have configured 2 steps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;connect to &lt;A href="https://nificluster.info/nifi/" target="_blank" rel="noopener"&gt;https://nificluster.info/nifi/&lt;/A&gt;&amp;nbsp; with login and password. This steps it's ok, the required string - "log out" - and required status code 200 works. In this step I've configured viariables username, password for logging and follow redirects flag enable.&lt;/LI&gt;&lt;LI&gt;connect to api &lt;A href="https://nificluster.info/nifi-api/flow/cluster/summary" target="_blank" rel="noopener"&gt;https://nificluster.info/nifi-api/flow/cluster/summary&lt;/A&gt; without any parameters except requird string with number of cluster nodes and required status code 200&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;.&lt;/P&gt;&lt;DIV class="m2"&gt;&lt;DIV class="mrg"&gt;&lt;DIV class="client"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="targetTxt"&gt;&lt;DIV class="txtDiv border3d"&gt;Who could help me resolve this 401 error on the api nifi?&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 09:58:43 GMT</pubDate>
    <dc:creator>Olwe</dc:creator>
    <dc:date>2022-09-13T09:58:43Z</dc:date>
    <item>
      <title>Monitoring NiFi and 401 error api check</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Monitoring-NiFi-and-401-error-api-check/m-p/352151#M236449</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I've trying to monitoring nifi api. In our nifi we have configure oidc login and it works fine.&lt;/P&gt;&lt;P&gt;As monitoring, we using zabbix.&lt;/P&gt;&lt;P data-unlink="true"&gt;The problem in zabbix is when try to check api page (https://nificluster.info/nifi-api/flow/cluster/summary) and I receive http 401 error.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the web scenario monitoring, I have configured 2 steps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;connect to &lt;A href="https://nificluster.info/nifi/" target="_blank" rel="noopener"&gt;https://nificluster.info/nifi/&lt;/A&gt;&amp;nbsp; with login and password. This steps it's ok, the required string - "log out" - and required status code 200 works. In this step I've configured viariables username, password for logging and follow redirects flag enable.&lt;/LI&gt;&lt;LI&gt;connect to api &lt;A href="https://nificluster.info/nifi-api/flow/cluster/summary" target="_blank" rel="noopener"&gt;https://nificluster.info/nifi-api/flow/cluster/summary&lt;/A&gt; without any parameters except requird string with number of cluster nodes and required status code 200&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;.&lt;/P&gt;&lt;DIV class="m2"&gt;&lt;DIV class="mrg"&gt;&lt;DIV class="client"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="targetTxt"&gt;&lt;DIV class="txtDiv border3d"&gt;Who could help me resolve this 401 error on the api nifi?&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 09:58:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Monitoring-NiFi-and-401-error-api-check/m-p/352151#M236449</guid>
      <dc:creator>Olwe</dc:creator>
      <dc:date>2022-09-13T09:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring NiFi and 401 error api check</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Monitoring-NiFi-and-401-error-api-check/m-p/352171#M236456</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/100396"&gt;@Olwe&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;How is zabbix authenticating it self with your NiFi?&amp;nbsp; When NiFi is secured, all clients must be authenticated and authorized.&amp;nbsp; &amp;nbsp;An HTTP 401 means the client was not authorized.&lt;BR /&gt;&lt;BR /&gt;NiFi does not use sessions.&amp;nbsp; So when a user logs in via a username and password, if the authentication was successful, a bearer token is issued for the user for that specific NiFi node.&amp;nbsp; &amp;nbsp;That bearer token will remain valid for the duration configured in your NiFi login provider or until the logout endpoint is invoked.&amp;nbsp; The client is expected to include that bearer token in all subsequent requests.&amp;nbsp; If you hit a NiFi rest-api endpoint like&amp;nbsp;.../nifi-api/flow/cluster/summary without a bearer token or a client certificate, the client will be treated as "anonymous" and not authorized.&amp;nbsp; &amp;nbsp;You should see this unauthorized endpoint request logged in the nifi-user.log.&amp;nbsp; When you access rest-api endpoints via the browser which you used to login, the browser takes care of including the bearer token.&amp;nbsp; I am not familiar with Zabbix, but same requirements exist (get bearer token and include bearer token in future rest-api calls)&lt;BR /&gt;&lt;BR /&gt;For example, obtaining a token using a login provider:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl 'https://&amp;lt;nifi-hostname&amp;gt;:&amp;lt;nifi-port&amp;gt;/nifi-api/access/token' \
  --data-raw 'username=&amp;lt;username&amp;gt;&amp;amp;password=&amp;lt;password&amp;gt;' \
  --compressed \
  --insecure&lt;/LI-CODE&gt;&lt;P&gt;Above will return the &amp;lt;bearer token&amp;gt;.&lt;BR /&gt;&lt;BR /&gt;Then you would use that bearer token in your future rest-api requests:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl 'https://&amp;lt;nifi-hostname&amp;gt;:&amp;lt;nifi-port&amp;gt;/nifi-api/flow/cluster/summary' \
  -H 'Authorization: Bearer &amp;lt;bearer token&amp;gt;' \
  --compressed \
  --insecure&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic"&gt;If you found that the provided solution(s) assisted you with your query, please take a moment to login and click&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Accept as Solution&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;below each response that helped.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 20:19:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Monitoring-NiFi-and-401-error-api-check/m-p/352171#M236456</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-09-13T20:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring NiFi and 401 error api check</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Monitoring-NiFi-and-401-error-api-check/m-p/353842#M236810</link>
      <description>&lt;P&gt;Hi and thanks for your reply.&lt;/P&gt;&lt;P&gt;Integration with OIDC and NiFi it's no easy. I've tried you suggestion but don't works, seems the header don't follow the flow.&lt;/P&gt;&lt;P&gt;But now, I've resolved using the certificate when I call the url. I've trusted zabbix certificate with nifi and use this curl:&lt;/P&gt;&lt;P&gt;curl &lt;A href="https://nificluster.info/nifi-api/flow/cluster/summary" target="_blank"&gt;https://nificluster.info/nifi-api/flow/cluster/summary&lt;/A&gt; --insecure -H "Host: nificluster.info" --cert /pathcertificate/certificate_zabbix.pem --key /pathcertificate/certificate_zabbix.key&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I can check the cluster status "without" login.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 08:59:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Monitoring-NiFi-and-401-error-api-check/m-p/353842#M236810</guid>
      <dc:creator>Olwe</dc:creator>
      <dc:date>2022-10-03T08:59:06Z</dc:date>
    </item>
  </channel>
</rss>

