<?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 Nifi authentication fails when a HTTPS load balancer is used in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343785#M234006</link>
    <description>&lt;P&gt;Hi, I am new to Nifi, so please excuse if this is a noob question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have set up a 5 node Nifi cluster on GCP and using LDAP for authentication. I generated self-signed certs using the toolkit and I am able to login and access the UI at&amp;nbsp;&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;hostname&amp;gt;:8443/nifi/&lt;/A&gt;. Everything looks good with this setup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I added a HTTPS load balancer that routes the requests to backend Nifi nodes, when I try to access the Nifi UI at &lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;load-balancer&amp;gt;/nifi/&lt;/A&gt;&amp;nbsp;it throws below error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; INFO [NiFi Web Server-251] o.a.n.w.s.NiFiAuthenticationFilter Authentication Started xx.xx.xxx.x [&amp;lt;anonymous&amp;gt;] GET https://nifi.xxxxx.com/nifi-api/flow/current-user

WARN [NiFi Web Server-251] o.a.n.w.s.NiFiAuthenticationFilter Authentication Failed xx.xx.xxx.x GET https://nifi.xxxxx.com/nifi-api/flow/current-user [Anonymous authentication has not been configured.]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I generated the certificate using below command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;./tls-toolkit.sh standalone -n 'nifixxxxxx[1-5].xxxx.com' -S 'xxxxxxx' -P 'xxxxxxx' -C 'CN=&amp;lt;ldap-userid&amp;gt;, OU=NIFI'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Can someone help me understand why the user id shows as anonymous and how to fix it?&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2022 05:05:47 GMT</pubDate>
    <dc:creator>bk1937</dc:creator>
    <dc:date>2022-05-16T05:05:47Z</dc:date>
    <item>
      <title>Nifi authentication fails when a HTTPS load balancer is used</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343785#M234006</link>
      <description>&lt;P&gt;Hi, I am new to Nifi, so please excuse if this is a noob question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have set up a 5 node Nifi cluster on GCP and using LDAP for authentication. I generated self-signed certs using the toolkit and I am able to login and access the UI at&amp;nbsp;&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;hostname&amp;gt;:8443/nifi/&lt;/A&gt;. Everything looks good with this setup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I added a HTTPS load balancer that routes the requests to backend Nifi nodes, when I try to access the Nifi UI at &lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;load-balancer&amp;gt;/nifi/&lt;/A&gt;&amp;nbsp;it throws below error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; INFO [NiFi Web Server-251] o.a.n.w.s.NiFiAuthenticationFilter Authentication Started xx.xx.xxx.x [&amp;lt;anonymous&amp;gt;] GET https://nifi.xxxxx.com/nifi-api/flow/current-user

WARN [NiFi Web Server-251] o.a.n.w.s.NiFiAuthenticationFilter Authentication Failed xx.xx.xxx.x GET https://nifi.xxxxx.com/nifi-api/flow/current-user [Anonymous authentication has not been configured.]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I generated the certificate using below command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;./tls-toolkit.sh standalone -n 'nifixxxxxx[1-5].xxxx.com' -S 'xxxxxxx' -P 'xxxxxxx' -C 'CN=&amp;lt;ldap-userid&amp;gt;, OU=NIFI'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Can someone help me understand why the user id shows as anonymous and how to fix it?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 05:05:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343785#M234006</guid>
      <dc:creator>bk1937</dc:creator>
      <dc:date>2022-05-16T05:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi authentication fails when a HTTPS load balancer is used</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343829#M234015</link>
      <description>&lt;P&gt;&lt;SPAN&gt;With LB in place, you are reaching NiFi as anonymous when LB has not been configured to pass the user identity to NiFi that what I understand from looking the log snippet.. Please refer this page to check if proxy details are configured correctly&amp;nbsp; &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#proxy_configuration" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#proxy_configuration&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 13:55:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343829#M234015</guid>
      <dc:creator>ckumar</dc:creator>
      <dc:date>2022-05-16T13:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi authentication fails when a HTTPS load balancer is used</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343837#M234017</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97928"&gt;@bk1937&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I 100% agree with the advice given by&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/42173"&gt;@ckumar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also consider for a basic LB setup, you'll need to use sticky sessions.&lt;BR /&gt;You mention that you are "logging in", so I take this to mean that your user(s) are not using certificate based authentication, but rather using a login provider like ldap-provider or kerberos-provider.&lt;BR /&gt;&lt;BR /&gt;When you access "&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;load-balancer&amp;gt;/nifi/&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;" without using sticky sessions, the request may go to node 1 where you get the login window.&amp;nbsp; You enter your credentials and get back a bearer token that your browser now stores for the "&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;load-balancer&amp;gt;/nifi/&lt;/A&gt;&amp;nbsp;" endpoint.&amp;nbsp; &amp;nbsp;The issue here is that bearer token is only valid for the host that issued it (node1).&amp;nbsp; So immediately&amp;nbsp;after node1 sent your browser this token, it attempts to redirect your browser to UI.&amp;nbsp; Without Sticky Sessions, your LB may send the redirect to node 2 - 5) and those nodes will not know anything about that client bearer token since they will not have the corresponding&amp;nbsp;server side token.&amp;nbsp; This the token is rejected and your user is treated as anonymous.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;You'll need to investigate your LB to see how to enable sticky sessions.&amp;nbsp; Sticky sessions will make sure all subsequent request continue to get routed to same host as original request.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you any of the responses assisted with your query, please take a moment to login and click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below each of those posts.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 15:31:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343837#M234017</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-05-16T15:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi authentication fails when a HTTPS load balancer is used</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343953#M234055</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/42173"&gt;@ckumar&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;for your responses.&lt;BR /&gt;I enabled session affinity on LB and it resolved the issue. I am able to login using LB endpoint.&amp;nbsp;&lt;BR /&gt;What&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/42173"&gt;@ckumar&lt;/a&gt; said makes sense but why isn't it causing any issue for my cluster? Is it because I am using just basic LB and not Reverse proxy?&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 02:56:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-authentication-fails-when-a-HTTPS-load-balancer-is-used/m-p/343953#M234055</guid>
      <dc:creator>bk1937</dc:creator>
      <dc:date>2022-05-18T02:56:03Z</dc:date>
    </item>
  </channel>
</rss>

