Search code examples
apache-nifi

how to configure Nifi 1.15.2 to use HTTP without authentication


Nifi v1.15.2 use https and authentication by default whereas it was not the case for older version of Nifi for example v1.13.2. I want to configure nifi v1.15.2 using http and without authentication
I think i have to modify one of these properties but i don't really know which ones
below the initial configuration

# web properties #
#############################################

# For security, NiFi will present the UI on 127.0.0.1 and only be accessible through this loopback interface.
# Be aware that changing these properties may affect how your instance can be accessed without any restriction.
# We recommend configuring HTTPS instead. The administrators guide provides instructions on how to do this.

nifi.web.http.host=
nifi.web.http.port=
nifi.web.http.network.interface.default=

#############################################

nifi.web.https.host=127.0.0.1
nifi.web.https.port=8443
nifi.web.https.network.interface.default=
nifi.web.jetty.working.directory=./work/jetty
nifi.web.jetty.threads=200
nifi.web.max.header.size=16 KB
nifi.web.proxy.context.path=
nifi.web.proxy.host=
nifi.web.max.content.size=
nifi.web.max.requests.per.second=30000
nifi.web.max.access.token.requests.per.second=25
nifi.web.request.timeout=60 secs
nifi.web.request.ip.whitelist=
nifi.web.should.send.server.version=true

# Include or Exclude TLS Cipher Suites for HTTPS
nifi.web.https.ciphersuites.include=
nifi.web.https.ciphersuites.exclude=

# security properties #
nifi.sensitive.props.key=VdY5sz08vgaK7QZ3kfh1jsC0N0bSKK5F
nifi.sensitive.props.key.protected=
nifi.sensitive.props.algorithm=NIFI_PBKDF2_AES_GCM_256
nifi.sensitive.props.additional.keys=

nifi.security.autoreload.enabled=false
nifi.security.autoreload.interval=10 secs
nifi.security.keystore=./conf/keystore.p12
nifi.security.keystoreType=PKCS12
nifi.security.keystorePasswd=63267bec3aac8ab9ef98aac68f49f603
nifi.security.keyPasswd=63267bec3aac8ab9ef98aac68f49f603
nifi.security.truststore=./conf/truststore.p12
nifi.security.truststoreType=PKCS12
nifi.security.truststorePasswd=98d7c94fa28a9ba24a5c7f9c1a8105c6
nifi.security.user.authorizer=single-user-authorizer
nifi.security.allow.anonymous.authentication=false
nifi.security.user.login.identity.provider=single-user-provider
nifi.security.user.jws.key.rotation.period=PT1H
nifi.security.ocsp.responder.url=
nifi.security.ocsp.responder.certificate=

I tried to modify like this, i removed value for the key nifi.web.https.host and nifi.web.https.port and add it to nifi.web.http.host and nifi.web.http.port like this :

# For security, NiFi will present the UI on 127.0.0.1 and only be accessible through this loopback interface.
# Be aware that changing these properties may affect how your instance can be accessed without any restriction.
# We recommend configuring HTTPS instead. The administrators guide provides instructions on how to do this.

nifi.web.http.host=localhost
nifi.web.http.port=8080
nifi.web.http.network.interface.default=

#############################################

nifi.web.https.host=
nifi.web.https.port=
nifi.web.https.network.interface.default=
nifi.web.jetty.working.directory=./work/jetty
nifi.web.jetty.threads=200
nifi.web.max.header.size=16 KB
nifi.web.proxy.context.path=
nifi.web.proxy.host=
nifi.web.max.content.size=
nifi.web.max.requests.per.second=30000
nifi.web.max.access.token.requests.per.second=25
nifi.web.request.timeout=60 secs
nifi.web.request.ip.whitelist=
nifi.web.should.send.server.version=true

But in log file i got this error

2022-01-07 10:33:08,341 ERROR [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.NiFiWebApiSecurityConfiguration': Unsatisfied dependency expressed through method 'setJwtAuthenticationProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.security.configuration.JwtAuthenticationSecurityConfiguration': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowController': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: Remote input HTTPS is enabled but nifi.web.https.port is not specified.
2022-01-07 10:33:08,341 ERROR [NiFi logging handler] org.apache.nifi.StdErr Shutting down...

Any idea?


Solution

  • To remove authentication, one would need to do what was done for the configuration of NiFi pre-1.14.0, as with 1.14.0 "NiFi now starts up in a mode enabling security features by default. This means NiFi starts up with HTTPS only now instead of HTTP and it requires a specific auto generated username and password to login or the user can explicitly set the username and password which will be used via the provided toolkit. Gone are the days of firing a default NiFi and it is accessible via HTTP without authentication." https://cwiki.apache.org/confluence/display/NIFI/Release+Notes#ReleaseNotes-Version1.14.0

    Of course, the values of "nifi.web.http.host= and nifi.web.http.port=" need to be set. I would also consider changing the keystore and truststore values, plus nifi.security.user.authorizer as well to blank.

    If this all doesnt work, what I would recommend is downloading Nifi 1.13.2 and trying to see if using the nifi.properties that it has by default will work in NiFi 1.15.2. This is the best start.

    If this answer has assisted you in solving the issue, please feel free to accept this answer as the solution.