0

I'm trying to create processor with nifi-api using postman. And have some problems to get access to create or update operations with processor. I'm running apache nifi as docker container (latest version).I'm just running latest version of nifi on docker, login with generated login and password and checks at browser that all works fine). Interesting moment - i can reed all information about this processor using the same URL like creating of processor (different only with methods GET and POST).

I'm already read access token in JWT format and added it to headder but it's not working at all. enter image description here enter image description here enter image description here

Can anyone give me a advice, what i can do to solve this problem? I will be very grateful!

  • How to reproduce your 403 error problem? Without reproduce it is hard to answer. – Bench Vue Aug 11 '23 at 10:02
  • I'm just running latest version of nifi on docker, login with generated login and password and checks at browser that all works fine). – Антон Павлецов Aug 11 '23 at 12:57
  • can you point the `docker-compose.yml` file for nifi? – Bench Vue Aug 11 '23 at 13:06
  • i'm started nifi step by step of this tutorial from docker https://hub.docker.com/r/apache/nifi. – Антон Павлецов Aug 11 '23 at 13:12
  • I can get the access token and cookie, How to get `process-groups` list. I saw your second image, Need I place some block in Nifi? – Bench Vue Aug 11 '23 at 13:27
  • nifi creates process-groups while initialization. You need just open your browser on your host (localhost) and port (8443 like in tutorial) . At process-groups name NiFi-Flow you can see uuid of this group. – Антон Павлецов Aug 11 '23 at 13:37
  • I got the process group ID by `https://localhost:8443/nifi-api/flow/process-groups/root/status?recursive=true` and got information of it's process-group by uuid `https://localhost:8443/nifi-api/flow/process-groups/{uuid}`, You want to update the process's POST call and get 443 error? – Bench Vue Aug 11 '23 at 13:42
  • i'm trying to create processor on default porcess-group. No problem to get info about processor that already exists on default porcess-group, that's dont throws any error status. But if you trying to create processor? throws 403(forbidden). So you can get example of json to create processor: create processor in browser, get his json info by request and delete processor in browser. – Антон Павлецов Aug 11 '23 at 13:50
  • by nifi rest api - getting info of a processor and create a processor have the same url but different methods and boy – Антон Павлецов Aug 11 '23 at 13:52
  • OK, I can reproduce 403, If PUT API call for just change compose position with JSON body. It copied from Browser's Network's JSON payload. Now I can try to figure out why 403 error, Let me figure out. – Bench Vue Aug 11 '23 at 13:59
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/254890/discussion-between---and-bench-vue). – Антон Павлецов Aug 11 '23 at 14:01
  • I just realize it's `Cross-Site Request Forgery Protection` in [here](https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html) but I can't address it sorry, thanks for your help. – Bench Vue Aug 11 '23 at 16:25
  • @АнтонПавлецов I believe you need to pass the `Access Token` in the Auth tab of the Postman, instead of actually creating a property with `Authorisation` on the headers tab. Under the `Auth` tab select Type : Bearer Token and provide your token and then make the API call. Hope that should work. – DataWrangler Aug 14 '23 at 10:11
  • Thanks for your option, but this doesn't work :( – Антон Павлецов Aug 15 '23 at 10:50
  • So, GET is working with your token and POST is not working? – daggett Aug 15 '23 at 13:32
  • Please provide your POST payload – daggett Aug 15 '23 at 14:06

0 Answers0