Neither the ConsumeIMAP or ConsumePOP3 NiFi processors support Oauth2 for authentication.
NiFi does have an StandardOauth2AccessTokenProvider controller service. I would recommend opening an Apache NiFi Jira asking to have Oauth2 via this existing controller service integrated in to these processors. As an open source project contribution are always welcome.
If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.