Dirk Hennig created NIFI-16636:
----------------------------------
Summary: NiFi 2.12.0: Recursive processor REST request with
includeDescendantGroups=true fails with JWT invalid_token when using X.509
authentication
Key: NIFI-16636
URL: https://issues.apache.org/jira/browse/NIFI-16636
Project: Apache NiFi
Issue Type: Bug
Components: NiFi API
Affects Versions: 2.12.0
Environment: NiFi version: 2.12.0
Authentication: X.509 client certificate / mTLS
REST client: NiFi InvokeHTTP and administrator test
Endpoint:
GET /nifi-api/process-groups/{processGroupId}/processors
Reporter: Dirk Hennig
After upgrading to Apache NiFi 2.12.0, the REST API endpoint for retrieving
processors recursively from a Process Group fails when
{{includeDescendantGroups=true}} is used.
The client authenticates using an X.509 client certificate (mTLS). No OAuth2 or
Bearer token authentication is used.
The following request fails:
GET
/nifi-api/process-groups/\{processGroupId}/processors?includeDescendantGroups=true
The response is {{401 Unauthorized}} with an OAuth/JWT-related error similar to:
Unauthorized
error="invalid_token",
error_description="An error occurred while attempting to decode the Jwt: Signed
JWT rejected: Another algorithm expected, or no matching key(s) found",
error_uri="https://tools.ietf.org/html/rfc6750#section-3.1",
resource_metadata="https://<nifi-host>:8443/nifi-api/.well-known/oauth-protected-resource"
However, the otherwise identical request works when recursive retrieval is
disabled:
GET
/nifi-api/process-groups/\{processGroupId}/processors?includeDescendantGroups=false
h3. Steps to reproduce
# Run Apache NiFi 2.12.0 with X.509 client certificate authentication.
# Create a Process Group containing processors and descendant Process Groups.
# Authenticate against the NiFi REST API using a valid client certificate.
# Request processors without recursive traversal:
GET
/nifi-api/process-groups/\{processGroupId}/processors?includeDescendantGroups=false
*Result:* Successful.
# Make the same request with recursive traversal enabled:
GET
/nifi-api/process-groups/\{processGroupId}/processors?includeDescendantGroups=true
*Result:* {{401 Unauthorized}} with:
error="invalid_token"
error_description="An error occurred while attempting to decode the Jwt: Signed
JWT rejected: Another algorithm expected, or no matching key(s) found"
h3. Expected behavior
The call:
GET
/nifi-api/process-groups/\{processGroupId}/processors?includeDescendantGroups=true
should return all processors contained in the specified Process Group and its
descendant Process Groups when the caller is authenticated and authorized.
The authentication mechanism should remain X.509 and should not result in a JWT
decoding error when the client did not provide a JWT.
h3. Impact
We use this REST endpoint to discover/search {*}all processors across the
complete NiFi canvas{*}, including processors located in nested Process Groups.
Without {{{}includeDescendantGroups=true{}}}, the client has to implement its
own recursive traversal of all Process Groups and issue separate REST requests
for every Process Group.
This is therefore a regression for an existing automation/monitoring use case.
h3. Regression
*Yes.*
The same recursive API request worked previously. The issue is observed with
{*}NiFi 2.12.0{*}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)