mcgilman commented on a change in pull request #4099: NIFI-7170: Add option to 
disable anonymous authentication
URL: https://github.com/apache/nifi/pull/4099#discussion_r387717265
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/src/main/java/org/apache/nifi/web/security/anonymous/NiFiAnonymousAuthenticationRequestToken.java
 ##########
 @@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.web.security.anonymous;
+
+import org.apache.nifi.web.security.NiFiAuthenticationRequestToken;
+
+import static 
org.apache.nifi.authorization.user.StandardNiFiUser.ANONYMOUS_IDENTITY;
+
+/**
+ * This is an authentication request for an anonymous user.
+ */
+public class NiFiAnonymousAuthenticationRequestToken extends 
NiFiAuthenticationRequestToken {
+
+    final boolean secureRequest;
 
 Review comment:
   No. All users of unsecured instances will be anonymous. The existing filter 
chain follows a pattern where the filter extracts the authentication attempt 
from the incoming request. If the request does not contain an attempt to 
authenticate then it returns null and the next authentication filter is 
checked. 
   
   The authentication provider contains the logic to actually validate the 
authentication attempt. For instance, with JTM the filter extracts the bearer 
token and provides it to the authentication provider to verify the token. If 
there is no bearer token in the request, the filter returns null.
   
   For anonymous authentication, every request is an attempt to authenticate as 
anonymous. The only request specific detail we need for the authentication 
provider to do its job is whether the request was secure or not.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to