Member since
06-15-2023
3
Posts
1
Kudos Received
0
Solutions
06-16-2023
04:07 AM
@steven-matison @MattWho Thank you first for your interaction. For my case the SSL Context Service is not necessary to request from any unprotected API. Our NIFI-API need authentication to be used also within NIFI UI. InvokeHTTP didn't succeed to request anything from the API without authentication. But here I will explain you how it could be possible. I created a pipeline composed of theses processors: 1- GenerateFlowFile: Create FlowFile with username and password of the technical user 2- InvokeHTTP: Ask for an access token from the token API endpoint 3- UpdateAttribute: Format the token and save it as ‘Authorization’ attribute 4- InvokeHTTP: Use this attribute for a HTTP request. Here is every processor properties: 1- GenerateFlowFile: Technical user declaration 2- InvokeHTTP: Ask for access token 3- UpdateAttribute: Authorization attribute 4- InvokeHTTP: Request Processor Status But this is not the proper and clean way to do it for such reasons: - I need to provide the password of the technical user with a visible way - Each time we consult the API, we will generate a new access token. But a token should be used until its expiration time, and not generating so many tokens. That is why I tried to use the StandardOauth2AccessTokenProvider controller service.. Who should be responsible of fetching access token and attach it to the header of the InvokeHTTP processor request. But unfortunately I am getting the previous described error.
... View more
06-15-2023
12:13 PM
1 Kudo
@VidyaSargur thank you very much for your warm welcome 😀
... View more
06-15-2023
03:12 AM
Dear all, My NIFI version is 1.16.3. I am trying to fetch the status of some processors (NIFI-API) within NIFI it self using InvokeHTTP processor. My NIFI-API is protected and need authentication to be used. I have a technical user with username and password that could get a token from the token API endpoint: https://nifi.company.com/nifi-api/access/token. So I defined a controller service OAuth2AccessTokenProvider to generate access tokens. From next defined API endpoint, I want to get the proprieties of a NIFI processor by its ID https://nifi.company.com/nifi-api/processors/ae91429e-es3a-1eq9-fe53-b13680cff1e5 I used for that the InvokeHTTP processor with a GET HTTP method and by linking the OAuth2 Access Token provider field to the previously defined OAuth2AccessTokenProvider controller service. But I am getting such error InvokeHTTP Failed to properly initialize Processor. If still scheduled to run, NiFi will attempt to initialize and run the Processor again after the 'Administrative Yield Duration' has elapsed. Failure is due to java.io.UncheckedIOException: OAuth2 access token request failed: java.io.UncheckedIOException: OAuth2 access token request failed - Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'utzcnd154ffd54gedg6g5fd6gdfg656556gdg5gdgt54894455444454fsdf45fd': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (String)"utzcnd154ffd54gedg6g5fd6gdfg656556gdg5gdgt54894455444454fsdf45fd"[truncated 548 chars]; line: 1, column: 81] I changed the real Token value with a random series of characters.
... View more