Member since
01-15-2019
5
Posts
1
Kudos Received
0
Solutions
12-14-2021
12:03 PM
1 Kudo
@gvkarthik93 The HandleHTTPRequest processor only support user based authentication via a mutual TLS handshake. But there is no authorization built in to the processor. So if the truststore configured in the configured SSLContextService contains the needed trustedCertEntries to trust a user/client certificate presented in the handshake, that user would be allowed to send traffic to this listener. The processor could then route the success relationship via a connection to a routeOnAttribute processor that checks the dn set in the "http.subject.dn" FlowFile attribute created by the HandleHttpRequest processor to see if matches a list of DN. Based in that outcome decide to either route the FlowFile to a HandleHTTPResponse processor that responds with not authorized or route down an authorized path and respond accordingly. I want to check if the username and password is correct or not Check against what? NiFi has no local users with passwords for authentication, nor do any NiFi processors have any integration in to an external user authenticator like ldap. Even if you were to pass a username and password via a header on the request, there is no native processor that could take that username and password and verify it. Maybe you could use a scripting processor to validate the username and password against an external service like ldap. But between HandleHTTPRequest and that scripting processor, that user's name and password would be in plaintext within the FlowFiles attributes which is not ideal. Also keep in mind that if you do not use TLS at all, anything you send over the connection is not encrypted and in plain text. Hope this helps answer your query, Matt
... View more
04-16-2019
12:42 AM
@Karthik Gullapalli You can use ExtractText processor to extract elements of Array then using Update attribute and ReplaceText processor we can create the final json. Flow: 1.ExtractText //add new property with regex expression to extract a,1
2.ReplaceText //always replace as replacement strategy and use nifi expression language to prepare json. (or) Use the approach specified in this article 2.2 to iterate through array of elements and then use nifi expression language to create output flowfile in json format using ReplaceText processor.
... View more
04-11-2019
08:58 AM
You can refer to this answer: NiFi - How to use JOLT to add json key:value dynamically to the Flowfile content?
... View more
01-15-2019
11:36 PM
@Pierre Villard @Andy Liang could you tell how to do the second approach you've suggest? "As a final side note: if you need to perform a login/password authentication like Basic Authentication (with HTTP headers), then you don't need all of this, and you just need to check the attributes sent by the user in the request with a RouteOnAttribute processor and using the expression language."
... View more