<?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 Re: How to access NiFi API on a secure NiFi instance in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190587#M59067</link>
    <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/525/mclark.html" nodeid="525"&gt;@Matt Clarke&lt;/A&gt;, your last sentence ("everything you do via NiFi's UI, are nothing more then calls to nifi-api") cleared it all up for me.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2017 21:44:24 GMT</pubDate>
    <dc:creator>Raj_B</dc:creator>
    <dc:date>2017-04-06T21:44:24Z</dc:date>
    <item>
      <title>How to access NiFi API on a secure NiFi instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190585#M59065</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In a secure NiFi instance (LDAP/SSL), our users are unable to access the NiFi API. When this URL - &lt;A href="https://nifiserver:8077/nifi-api/system-diagnostics" target="_blank"&gt;https://nifiserver:8077/nifi-api/system-diagnostics&lt;/A&gt; - is launched in a browser, this error shows up : "Unable to perform the desired action due to insufficient permissions. Contact the system administrator."&lt;/P&gt;&lt;P&gt;In NiFi Admin guide's access policies (https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#access-policies), I did not find anything related to granting permissions for NiFi API access.&lt;/P&gt;&lt;P&gt;So, how do you let users access NiFi API in a secure environment.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 20:59:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190585#M59065</guid>
      <dc:creator>Raj_B</dc:creator>
      <dc:date>2017-04-06T20:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to access NiFi API on a secure NiFi instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190586#M59066</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/10100/rbolla.html" nodeid="10100"&gt;@Raj B&lt;/A&gt;&lt;P&gt;There is no specific policy specific to complete nifi-api access.  Different nifi-api end-points will require that the user making the call to that end-point has the equivalent access policy.&lt;/P&gt;&lt;P&gt;For example, in order for a user to view the "system diagnostics" via the NiFi UI, the user will need to have bee granted the global policy "view system diagnostics".  &lt;/P&gt;&lt;PRE&gt;curl 'https://&amp;lt;hostname&amp;gt;:&amp;lt;port&amp;gt;/nifi-api/system-diagnostics' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJuaWZpYWRtaW4iLCJpc3MiOiJMZGFwUHJvdmlkZXIiLCJhdWQiOiJMZGFwUHJvdmlkZXIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJuaWZpYWRtaW4iLCJraWQiOjEsImV4cCI6MTQ5MTUyNzg0OSwiaWF0IjoxNDkxNDg0NjQ5fQ.1xou9lsBLBMaNuUUGJjebuYE1E8dzGWA7IPzb6_vEv0' --compressed --insecure&lt;/PRE&gt;&lt;P&gt; The "Bearer" presented in the rest-api call will be checked against the access policies assigned to that user.&lt;/P&gt;&lt;P&gt;Just remember that everything you do via NiFi's UI, are nothing more then calls to nifi-api.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 21:40:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190586#M59066</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2017-04-06T21:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to access NiFi API on a secure NiFi instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190587#M59067</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/525/mclark.html" nodeid="525"&gt;@Matt Clarke&lt;/A&gt;, your last sentence ("everything you do via NiFi's UI, are nothing more then calls to nifi-api") cleared it all up for me.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 21:44:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190587#M59067</guid>
      <dc:creator>Raj_B</dc:creator>
      <dc:date>2017-04-06T21:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to access NiFi API on a secure NiFi instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190588#M59068</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am able to successfully access the &lt;EM&gt;/nifi-api/tenants/user-groups&lt;/EM&gt; rest API using curl with --insecure option.&lt;/P&gt;&lt;P&gt;But I get 403 error for an equivalent code in Java.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: &lt;A href="https://localhost:8080/nifi-api/tenants/user-groups" target="_blank"&gt;https://localhost:8080/nifi-api/tenants/user-groups&lt;/A&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Could you please advice?&lt;/P&gt;&lt;P&gt;Java code:&lt;/P&gt;&lt;PRE&gt;url = new URL(endPoint);
conn = (HttpsURLConnection) url.openConnection();
conn.setSSLSocketFactory(sslsocketfactory);
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept-Encoding", "gzip, deflate, br");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
conn.setRequestProperty("Accept", "*/*");
conn.setRequestProperty("Authorization", "Bearer " + "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjbj1uaWZpLWFkbWluLG91PXVzZXJzLGRjPWV4YW1wbGUsZGM9b3JnIiwiaXNzIjoiTGRhcFByb3ZpZGVyIiwiYXVkIjoiTGRhcFByb3ZpZGVyIiwicHJlZmVycmVkX3VzZXJuYW1lIjoibmlmaS1hZG1pbiIsImtpZCI6NSwiZXhwIjoxNTU2NTQ5NDkzLCJpYXQiOjE1NTY1MDYyOTN9.arWkNU_4K0VWc_v-FgERgjcNeU8-EjpyOP74-4pHkHs");

bufferedreader = new BufferedReader(new InputStreamReader(new GZIPInputStream(conn.getInputStream())));

String response;
while ((response = bufferedreader.readLine()) != null) {
    System.out.println("Response = " + response);
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Apr 2019 20:14:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-NiFi-API-on-a-secure-NiFi-instance/m-p/190588#M59068</guid>
      <dc:creator>ilavarasu_p</dc:creator>
      <dc:date>2019-04-29T20:14:05Z</dc:date>
    </item>
  </channel>
</rss>

