Skip to content

This is an Apache NiFi custom controller service which allows using the gcp credentials controller service as an oauth2 token provider for the InvokeHTTP processor to connect to Google APIs like search console or business profile.

License

Notifications You must be signed in to change notification settings

Digital-Loop/nifi-gcp-oauth2-access-token

Repository files navigation

GCP Oauth2 Access Token Provider

Fortunately Apache NiFi already ships with a couple of processors which provide connections to Google APIs. But since there are dozens of Google APIs and they are also subject to changes from time to time, it's to expect that NiFi cannot offer a specialized processor for all of them out of the box. In our case we were missing a processor for the APIs of Search Console and Business Profile.

This is why we created this custom controller service which adds an alternative oauth2 access token provider besides the StandardOauth2AccessTokenProvider. It provides the access token generated by the GCPCredentialsControllerService service for the InvokeHTTP processor. This way it can be used to generate requests towards any Google API with https support.

Installation

  1. Download the latest .nar file from the release page.
  2. Copy it to the lib directory of your Apache NiFi deployment.

Manual Build

mvn clean install
cp nifi-gcp-oauth2-provider-nar/target/nifi-gcp-oauth2-provider-nar-1.0.0.nar $NIFI_HOME/lib

Usage

  1. Create and configure a GCPCredentialsControllerService controller service.
  2. Create a GCPOauth2AccessTokenProvider controller service (provided by this module).
  3. You can add one or multiple scopes if required (the required scopes are mentioned in the corresponding Google API documentation).
  4. You can delegate to another account if you want to impersonate it.
  5. Create an InvokeHTTP processor and select your GCPOauth2AccessTokenProvider for the field "Request OAuth2 Access Token Provider".
  6. Configure http method, http url and headers as explained by the corresponding API documentation (the flow file content is used as the request body).

Examples

  1. Search Console API
  2. Business Profile API

About

This is an Apache NiFi custom controller service which allows using the gcp credentials controller service as an oauth2 token provider for the InvokeHTTP processor to connect to Google APIs like search console or business profile.

Topics

Resources

License

Stars

Watchers

Forks

Languages