Created 08-24-2023 07:31 AM
Hello! How's it going? I'm having trouble using the nifi API ....
Why can't I get token to use nifi api? , we use LDAP for authentication.
I am using the following (Python):
import requests
url = 'https://managmentsite.cloudera.site/apdazrusbicdpdfl/cdp-proxy-api/nifi-app/nifi-api/access/token'
headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
data = {
'username': 'user',
'password': 'pass'
}
response = requests.post(url, headers=headers, data=data, verify=False)
print(response.text)
print(response.status_code)
print(response.content)
the api endpoint is correct (url),
the username and password are correct,
What is the error due to?
Created 08-24-2023 09:17 AM
@BKZ
Can you share more about your environment setup.
Are you using Knox (from URL it appears so)? What topology is setup in knox for NiFI and NiFI-API?
What are all the methods of user authentication you have setup (nifi.properties file would help here)?
You are getting a 401 unauthorized response. Are you seeing anything logged in the nifi-user.log when you execute your python code?
Have you tried going directly to the NiFi node's nifi-api endpoint instead of going through the cdp-proxy-api?
What version of CDP and CFM are you using?
The details may help get more responses from within the community.
Thank you,
Matt
Created 08-28-2023 10:42 AM
@BKZ Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. If you are still experiencing the issue, can you provide the information @MattWho has requested? Thanks.
Regards,
Diana Torres,