Created 04-11-2017 03:04 PM
I am invoking an API command (nifi-api/access/token) to get the access token. But i am getting blank output. we have LDAP configured in NiFi Cluster and i am able to login to NiFi UI using my credentials. I have started exploring the NiFi rest API for the first time. Any help would be appreciated !!
Thank you in Advance,
Subash
Created 04-12-2017 01:24 AM
Here is the command you need, just fill in your appropriate values:
curl 'https://nifi-host:port/nifi-api/access/token' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'username=ldap-username&password=ldap-password' --compressed —insecure
And there you go, this will return the token you need.
The subsequent curl commands will need the token returned as part of the command:
-H 'Authorization: Bearer token-returned'
Created 04-11-2017 06:41 PM
Here is the format of the command you need to get a token:
curl 'https://nifi-host:port/nifi-api/access/token' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'username=ldap-username&password=ldap-password' --compressed —insecure
Then add the following to all of your subsequent curl commands
-H 'Authorization: Bearer token-returned’
Created 04-12-2017 01:24 AM
Here is the command you need, just fill in your appropriate values:
curl 'https://nifi-host:port/nifi-api/access/token' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'username=ldap-username&password=ldap-password' --compressed —insecure
And there you go, this will return the token you need.
The subsequent curl commands will need the token returned as part of the command:
-H 'Authorization: Bearer token-returned'
Created 04-12-2017 12:17 PM
Thank you @Wynner, I am able to get the access token using your code. can you please recommend the Rest API documentation which i should follow.
Created 04-12-2017 01:27 PM
The Rest API documentation will be found at the URL: https://nifi-host:port/nifi-docs/rest-api
Just replace the the nifi-host and port values with your information.