[ 
https://issues.apache.org/jira/browse/NIFI-12859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17823114#comment-17823114
 ] 

Roman commented on NIFI-12859:
------------------------------

Code-Screenshot how it could be solved. At the moment no permissions to push a 
MR

!image-2024-03-04-11-00-25-665.png|width=1017,height=287!

> OAUTH Refresh not working in ConsumeIMAP 
> -----------------------------------------
>
>                 Key: NIFI-12859
>                 URL: https://issues.apache.org/jira/browse/NIFI-12859
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.24.0, 1.25.0
>            Reporter: Roman
>            Priority: Major
>              Labels: OAuth2
>         Attachments: Bild (1).png, image-2024-03-04-11-00-25-665.png
>
>
> The ConsumeIMAP Processor implements the AbstractEmailProcessor.
> With Issue NIFI-11107 there was introduced OAUTH2 Support. Initial OAUTH is 
> working fine.
> But the refresh token implementation is not working with Credential Flow in 
> OAUTH Processor.
> Reason:
> Method to refresh token => oauth2AccessTokenProvider.getAccessDetails(); is 
> called only in onScheduled Method of AbstractEmailProcessor.
> But once the consumeIMAPProcessor is startet (also for cron based scheduling) 
> only the onTriggeredMethod will be triggered.
> OnScheduled will be only triggered on start 1time.
> OnTriggered will be also triggered after start of the consumeImapProcessor.
> So I would suggest to move the parts of code for oauth2AccessTokenProvider 
> from onScheduledMethod to onTriggeredMethod.
> Abstract-Email-Processor:
> [https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/AbstractEmailProcessor.java]
> Here you find details:
> https://github.com/apache/nifi/pull/6900



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to