Nifi Upload XML Template 403
I have a problem very similar to this one which has been marked as solved. I have followed the instructions which did not work.
I am trying to upload a Nifi XML template that I have previously exported, but am getting a 403.
I am running Nifi version 1.17.0 in a docker container.
The docker image is the latest, which should be 1.14.0
It is run using docker compose.
I am using Postman to send the REST requests.
The steps I have taken are:
- Generate an access token using: POST https://localhost:8443/nifi-api/access/token with an x-www.form-urlencoded body containing the username and password set in the .env file. This token is then used as the bearer token
- Get the root process-group id using: GET https://localhost:8443/nifi-api/flow/process-group/root then taking the id from processGroupFlow:id
- Failing to import an XML template using: POST https://localhost:8443/nifi-api/process-groups/{id}/templates/import where the body is raw XML, containing the previously exported template.
The error I receive is:
HTTP ERROR 403 Forbidden
URI:STATUS:MESSAGE:SERVLET:
| /nifi-api/process-groups/882f73b9-0183-1000-28e5-9508657cbe9f/templates/import |
| 403 |
| Forbidden |
| jerseySpring |
My docker compose yaml file is:
version: '2.2'
services:
nifi:
image: apache/nifi:latest
container_name: nifi
ports:
- ${HTTP_EXTERNAL_PORT}:${HTTP_INTERNAL_PORT}
- ${HTTPS_EXTERNAL_PORT}:${HTTPS_INTERNAL_PORT}
environment:
- SINGLE_USER_CREDENTIALS_USERNAME=${NIFI_USERNAME}
- SINGLE_USER_CREDENTIALS_PASSWORD=${NIFI_PASSWORD}
My docker compose .env file is
HTTPS_EXTERNAL_PORT=8443
HTTPS_INTERNAL_PORT=8443
HTTP_EXTERNAL_PORT=8080
HTTP_INTERNAL_PORT=8080
NIFI_USERNAME=myUsername
NIFI_PASSWORD=myPassword
Thank you for your help!

