mirror of https://github.com/apache/nifi.git
NIFI-10233 Corrected Anonymous Authentication for HTTP Access
- Enabled Standard Anonymous Authentication Filter when unencrypted HTTP is enabled Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes #6209.
This commit is contained in:
parent
d0db4c44bb
commit
047b3611bf
|
@ -696,6 +696,15 @@ public class NiFiProperties extends ApplicationProperties {
|
||||||
return sslPort;
|
return sslPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is HTTP without TLS enabled based on configuring nifi.web.http.port property
|
||||||
|
*
|
||||||
|
* @return HTTP enabled status
|
||||||
|
*/
|
||||||
|
public boolean isHttpEnabled() {
|
||||||
|
return getPort() != null;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isHTTPSConfigured() {
|
public boolean isHTTPSConfigured() {
|
||||||
return getSslPort() != null;
|
return getSslPort() != null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ public class NiFiWebApiSecurityConfiguration {
|
||||||
http.addFilterBefore(knoxAuthenticationFilter, AnonymousAuthenticationFilter.class);
|
http.addFilterBefore(knoxAuthenticationFilter, AnonymousAuthenticationFilter.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties.isAnonymousAuthenticationAllowed()) {
|
if (properties.isAnonymousAuthenticationAllowed() || properties.isHttpEnabled()) {
|
||||||
http.addFilterAfter(anonymousAuthenticationFilter, AnonymousAuthenticationFilter.class);
|
http.addFilterAfter(anonymousAuthenticationFilter, AnonymousAuthenticationFilter.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue