<?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: Not able to use the generated token in NIFI Rest API in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-use-the-generated-token-in-NIFI-Rest-API/m-p/373805#M241747</link>
    <description>&lt;P&gt;I have found the issue, and I have rectified it. Sorry, for the inconveniences.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 11:45:41 GMT</pubDate>
    <dc:creator>rupeshh</dc:creator>
    <dc:date>2023-07-12T11:45:41Z</dc:date>
    <item>
      <title>Not able to use the generated token in NIFI Rest API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-use-the-generated-token-in-NIFI-Rest-API/m-p/373799#M241744</link>
      <description>&lt;P&gt;I am trying to access the NIFI using Rest API. I am using python requests library. I am able to generate the token using username and password but when I am trying to use the token to get the expiration of the token or the list of counters processors that I have created I am getting it is &lt;STRONG&gt;unauthorized&lt;/STRONG&gt;.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
response = requests.post("https://127.0.0.1:8443/nifi-api/access/token?username=&amp;lt;username&amp;gt;&amp;amp;password=&amp;lt;password&amp;gt;",headers={"Content-Type":"application/x-www-form-urlencoded"},verify=False) # if verify is true it will throw verification failed
token = response.content.decode() # got the token

#checking the token expiration
response = requests.get("https://127.0.0.1:8443/nifi-api/access/token/expiration",headers={"Accept":"*/*","Authorization":"Bearer {}".format(token)}) # using the generated token

print(response)
"Unauthorized"&lt;/LI-CODE&gt;&lt;P&gt;I am able to get the response json using the same token through postman. So, I am not able to understand it. Is it because I am not verifying and not using any certificates causing the issue. Please anyone help me out here. Thanks!&lt;BR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/60150"&gt;@stevenmatison&lt;/a&gt;&amp;nbsp;can you please look into it.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 11:08:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-use-the-generated-token-in-NIFI-Rest-API/m-p/373799#M241744</guid>
      <dc:creator>rupeshh</dc:creator>
      <dc:date>2023-07-12T11:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to use the generated token in NIFI Rest API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-use-the-generated-token-in-NIFI-Rest-API/m-p/373805#M241747</link>
      <description>&lt;P&gt;I have found the issue, and I have rectified it. Sorry, for the inconveniences.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 11:45:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-use-the-generated-token-in-NIFI-Rest-API/m-p/373805#M241747</guid>
      <dc:creator>rupeshh</dc:creator>
      <dc:date>2023-07-12T11:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to use the generated token in NIFI Rest API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-use-the-generated-token-in-NIFI-Rest-API/m-p/373819#M241759</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105509"&gt;@rupeshh&lt;/a&gt;&amp;nbsp;, make a new post and describe your solution, then click Accept As Solution!!&amp;nbsp; &amp;nbsp; Then this post will be available in future for anyone experiencing similar.&amp;nbsp; &amp;nbsp;Great job getting it rectified!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 15:44:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-use-the-generated-token-in-NIFI-Rest-API/m-p/373819#M241759</guid>
      <dc:creator>steven-matison</dc:creator>
      <dc:date>2023-07-12T15:44:36Z</dc:date>
    </item>
  </channel>
</rss>

