Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Not able to use the generated token in NIFI Rest API


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 unauthorized.

import requests
response ="<username>&password=<password>",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("",headers={"Accept":"*/*","Authorization":"Bearer {}".format(token)}) # using the generated token


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!
@stevenmatison can you please look into it.



I have found the issue, and I have rectified it. Sorry, for the inconveniences.


@rupeshh , make a new post and describe your solution, then click Accept As Solution!!    Then this post will be available in future for anyone experiencing similar.   Great job getting it rectified!