You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2025/10/06 16:39:21 UTC

Re: [PR] NIFI-15021 - Support custom form parameters in StandardOauth2AccessTokenProvider [nifi]

exceptionfactory commented on code in PR #10352:
URL: https://github.com/apache/nifi/pull/10352#discussion_r2407369879


##########
nifi-extension-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/main/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProvider.java:
##########
@@ -396,6 +429,27 @@ private void getProperties(ConfigurationContext context) {
         }
 
         refreshWindowSeconds = context.getProperty(REFRESH_WINDOW).asTimePeriod(TimeUnit.SECONDS);
+
+        for (PropertyDescriptor descriptor : context.getProperties().keySet()) {
+            if (!descriptor.isDynamic() || !descriptor.getName().startsWith(FORM_PREFIX)) {
+                continue;
+            }
+
+            String parameterName = descriptor.getName().substring(FORM_PREFIX.length());
+            if (parameterName.isEmpty()) {
+                continue;
+            }
+
+            PropertyValue propertyValue = context.getProperty(descriptor);
+            if (propertyValue == null) {

Review Comment:
   Can `propertyValue` be `null`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org