mirror of https://github.com/apache/nifi.git
parent
ade5dc9bac
commit
5e341214a6
|
@ -33,7 +33,6 @@ import org.apache.nifi.web.security.x509.ocsp.OcspCertificateValidator;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class NiFiAuthenticationEntryPoint implements AuthenticationEntryPoint {
|
|||
public NiFiAuthenticationEntryPoint(NiFiProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Always returns a 403 error code to the client.
|
||||
*
|
||||
|
|
|
@ -50,7 +50,7 @@ public class NiFiAnonymousUserFilter extends AnonymousAuthenticationFilter {
|
|||
try {
|
||||
// load the anonymous user from the database
|
||||
NiFiUser user = userService.getUserByDn(NiFiUser.ANONYMOUS_USER_DN);
|
||||
|
||||
|
||||
// only create an authentication token if the anonymous user has some authorities
|
||||
if (!user.getAuthorities().isEmpty()) {
|
||||
NiFiUserDetails userDetails = new NiFiUserDetails(user);
|
||||
|
@ -68,10 +68,7 @@ public class NiFiAnonymousUserFilter extends AnonymousAuthenticationFilter {
|
|||
return authentication;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* setters */
|
||||
|
||||
public void setUserService(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ public class LoginAuthenticationFilter extends AbstractAuthenticationProcessingF
|
|||
|
||||
/**
|
||||
* Ensures the proxyChain is authorized before allowing the user to be authenticated.
|
||||
*
|
||||
*
|
||||
* @param proxyChain the proxy chain
|
||||
* @throws AuthenticationException if the proxy chain is not authorized
|
||||
*/
|
||||
|
@ -149,7 +149,7 @@ public class LoginAuthenticationFilter extends AbstractAuthenticationProcessingF
|
|||
|
||||
// generate JWT for response
|
||||
jwtService.addToken(response, authentication);
|
||||
|
||||
|
||||
// mark as successful
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.setContentType("text/plain");
|
||||
|
|
Loading…
Reference in New Issue