Support Questions
Find answers, ask questions, and share your expertise

Starting process group from Linux for Secured Nifi Instance

Highlighted

Starting process group from Linux for Secured Nifi Instance

Expert Contributor

Hi Friends , 

 

 I am trying to start a process group from Unix for a secured Nifi instance. I do have my trust store and key store files available but I am not sure how to reference them in the curl command. I read somewhere that I can give the -k option with curl if I want to do away with specifying the certs. So I tried running the following command 

 

curl -k -X PUT -H 'Content-Type: application/json' -d '{"id":"e3d11d1d-327b-1b5b-96a7-3cb59c48df17","state":"RUNNING"}' https://XXXX:8443/nifi-api/flow/process-groups/e3d11d1d-327b-1b5b-96a7-3cb59c48df17

 

However I am getting the following error.

curl: (56) Received HTTP code 403 from proxy after CONNECT

 

I guess I will need to reference my trust store and keystore , can someone help me here on how to do this ?

 

@Shu_ashu  sir - can you please help me here

@Matt 

1 REPLY 1
Highlighted

Re: Starting process group from Linux for Secured Nifi Instance

Cloudera Employee

@abhinav_joshi  NiFi supports "/access/kerberos" for kerberos/spnego negotiation and "/access/token" for username/password to provide token to use with "Authorization: Bearer" in api request.

So you can try to use below calls

1. TOKEN=$( curl -k "https://$HOSTNAME:9091/nifi-api/access/token" -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'username=xxx@REALM&password=secret' --compressed )

2. curl -v -X GET "https://$HOSTNAME:9091/nifi-api/flow/status" -H "Authorization: Bearer $TOKEN" -H "Connection: close" and so on.