You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/11/11 00:06:11 UTC

[GitHub] [nifi] MikeThomsen commented on a diff in pull request #6645: NIFI-10794 Made StandardOauth2AccessTokenProvider a verifiable contro…

MikeThomsen commented on code in PR #6645:
URL: https://github.com/apache/nifi/pull/6645#discussion_r1019718200


##########
nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/main/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProvider.java:
##########
@@ -338,4 +342,20 @@ private boolean isRefreshRequired() {
 
         return Instant.now().isAfter(expirationRefreshTime);
     }
+
+    @Override
+    public List<ConfigVerificationResult> verify(ConfigurationContext context, ComponentLog verificationLogger, Map<String, String> variables) {
+        ConfigVerificationResult.Builder builder = new ConfigVerificationResult.Builder()
+                .verificationStepName("Can acquire token");
+
+        try {
+            getAccessDetails();
+            builder.outcome(ConfigVerificationResult.Outcome.SUCCESSFUL);
+        } catch (Exception ex) {

Review Comment:
   <img width="757" alt="image" src="https://user-images.githubusercontent.com/108184/201231637-d1e1cbb8-3c5f-4a35-96ec-c7a42fd6217b.png">
   



-- 
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