Support Questions

Find answers, ask questions, and share your expertise

How to make an authenticated REST microservice calls using NiFi Processors

avatar

Can NiFi handle authenticated calls to REST microservices? For example before calling a REST service, the client needs to call an authentication service to obtain a token or session id. The session token is then passed into a REST call to post the data.

Is there any mechanism for maintaining the token and renewing it periodically?

1 ACCEPTED SOLUTION

avatar

If the token can be retrieved from an external resource via static credentials, you can use a separate InvokeHTTP processor to perform the authentication and load the token into flowfile content, which is then fed to the follow-on InvokeHTTP processor to perform the actual request.

@Pierre Villard has a good example of using OAuth 1.0 to generate credential material and then use that in a follow-on request.

View solution in original post

1 REPLY 1

avatar

If the token can be retrieved from an external resource via static credentials, you can use a separate InvokeHTTP processor to perform the authentication and load the token into flowfile content, which is then fed to the follow-on InvokeHTTP processor to perform the actual request.

@Pierre Villard has a good example of using OAuth 1.0 to generate credential material and then use that in a follow-on request.