[
https://issues.apache.org/jira/browse/NIFI-12859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roman updated NIFI-12859:
-------------------------
Description:
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 AbstractEmailProcessor.
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]
was:
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
Summary: OAUTH2 Token Refresh not working in AbstractEmailProcessor
(was: OAUTH Refresh not working in ConsumeIMAP )
> OAUTH2 Token Refresh not working in AbstractEmailProcessor
> -----------------------------------------------------------
>
> 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: 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 AbstractEmailProcessor.
> 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)