Maximo Open Forum

 View Only

 Oauth email listener

  • Administration
Preethi Ravindra Kumar's profile image
Preethi Ravindra Kumar posted 02-28-2022 18:38
Hello 

We are trying to setup the email listener with Oauth in IBM Maximo 7.6.1.2.

I had to increase the field length for both refresh token and access token in order for Maximo to store those values from Azure .

Currently using the configuration , Maximo is able to get the access token , however I get an Authenticate failed error 

SystemOut  Encountered error processing e-mails from mail server.
javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:723)
at javax.mail.Service.connect(Service.java:364)
at javax.mail.Service.connect(Service.java:245)
at psdi.common.emailstner.EmailListnerTask.readMessagesFromMailServer(EmailListnerTask.java:710)
at psdi.common.emailstner.EmailListnerTask.performTask(EmailListnerTask.java:265)
at psdi.common.emailstner.EmailListnerCron.cronAction(EmailListnerCron.java:49)
at psdi.server.CronTaskManager.callCronMethod(CronTaskManager.java:2566)
at psdi.server.CronTaskManager.access$1100(CronTaskManager.java:106)
at psdi.server.CronTaskManager$CronThread.run(CronTaskManager.java:3476)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
at java.util.concurrent.FutureTask.run(FutureTask.java:277)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:191)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:812)
Steven Shull's profile image
Steven Shull
I can't remember exactly the error message I got but there was another issue I had which was with Exchange Kiosk plans. Email listener with OAuth requires IMAPS and the Kiosk licensing plan of Office 365 does not include IMAPS. We had to switch our plan from Kiosk to Exchange Plan 1. I don't remember what the error message was but it was a generic error so it might be worth checking if that's your situation.
Preethi Ravindra Kumar's profile image
Preethi Ravindra Kumar
Thank you Steven .

I did test if the underlying imaps was enabled using a Microsoft link and it does work . However when I enabled debug on Maximo to see where the failure is all the debug statements show imap instead of imaps even if my port on the email listener is pointing to 993. Is there a setting that I am missing?



[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.smtp.starttls.enable = false

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.smtp.timeout = 300000

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.pop3.timeout = 300000

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.mime.decodetext.strict = false

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.smtp.connectiontimeout = 300000

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.imap.timeout = 300000

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.smtp.port =

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.mime.decodefilename = true

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.smtp.ssl.enable = false

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.imap.connectiontimeout = 300000

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.smtp.host = google

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.pop3.connectiontimeout = 300000

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.debug = true

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] prop: mail.smtp.sendpartial = 1

[2/28/22 15:17:08:148 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:148 [DEBUG] [MAXCRON-1] [CID-CRON-461939] ########## Fetching new access token

[2/28/22 15:17:08:367 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:367 [INFO] [MAXCRON-1] [CID-CRON-461939] BMXAA6719I - USER = (MAXADMIN) SPID = (82) app (null) object (CRONTASKINSTANCE) : select * from crontaskinstance where crontaskname= 'LSNRCRON' and instancename = 'LSNR602' OPTION (FAST 1000)

[2/28/22 15:17:08:367 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:367 [INFO] [MAXCRON-1] [CID-CRON-461939] BMXAA6719I - USER = (MAXADMIN) SPID = (82) app (null) object (INBOUNDCOMMCFG) : update inboundcommcfg set oauthaccesstokendexpdate=?,oauthaccesstoken=? where inboundcommcfgid=? and rowstamp=?

[2/28/22 15:17:08:367 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:367 [INFO] [MAXCRON-1] [CID-CRON-461939] BMXAA6721I - Bind value for OAUTHACCESSTOKENDEXPDATE = 2022-02-28 16:25:11.367

[2/28/22 15:17:08:367 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:367 [INFO] [MAXCRON-1] [CID-CRON-461939] BMXAA6721I - Bind value for OAUTHACCESSTOKEN = [B@b5f8efc7

[2/28/22 15:17:08:367 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:367 [INFO] [MAXCRON-1] [CID-CRON-461939] BMXAA6721I - Bind value for INBOUNDCOMMCFGID = 602

[2/28/22 15:17:08:367 PST] 00000113 SystemOut O 28 Feb 2022 15:17:08:367 [INFO] [MAXCRON-1] [CID-CRON-461939] BMXAA6721I - Bind value for rowstamp = [B@b9457e45

[2/28/22 15:17:08:382 PST] 00000113 SystemOut O DEBUG: JavaMail version 1.5.4

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: URL wsjar:file:/D:/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/StgCell01/MAXIMOCRON.ear/lib/pop3.jar!/META-INF/javamail.providers

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: successfully loaded resource: wsjar:file:/D:/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/StgCell01/MAXIMOCRON.ear/lib/pop3.jar!/META-INF/javamail.providers

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: successfully loaded resource: /META-INF/javamail.default.providers

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: Tables of loaded providers

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle]}

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsy stems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc]}

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle]

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: mail.imap.fetchsize: 16384

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: mail.imap.ignorebodystructuresize: false

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: mail.imap.statuscachetimeout: 1000

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: mail.imap.appendbuffersize: -1

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: mail.imap.minidletime: 10

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: disable AUTH=LOGIN

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: disable AUTH=PLAIN

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: enable SASL

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: SASL mechanisms allowed: XOAUTH2

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: closeFoldersOnStoreFailure

[2/28/22 15:17:08:398 PST] 00000113 SystemOut O DEBUG IMAP: trying to connect to host "outlook.office365.com", port 993, isSSL true

[2/28/22 15:17:08:617 PST] 00000113 SystemOut O * OK The Microsoft Exchange IMAP4 service is ready. [UwBKADAAUABSADAAMwBDAEEAMAAwADMAOQAuAG4AYQBtAHAAcgBkADAAMwAuAHAAcgBvAGQALgBvAHUAdABsAG8AbwBrAC4AYwBvAG0A]

[2/28/22 15:17:08:617 PST] 00000113 SystemOut O A0 CAPABILITY

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O A0 OK CAPABILITY completed.

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: AUTH: PLAIN

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: AUTH: XOAUTH2

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: protocolConnect login, host=outlook.office365.com, user=facilities@ql1.ucsf.edu, password=<non-null>

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: SASL authentication command trace suppressed

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: SASL Mechanisms:

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: XOAUTH2

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP:

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: SASL client XOAUTH2

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: SASL callback length: 2

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: SASL callback 0: javax.security.auth.callback.NameCallback@a61dd016

[2/28/22 15:17:08:632 PST] 00000113 SystemOut O DEBUG IMAP: SASL callback 1: javax.security.auth.callback.PasswordCallback@eb789629