<h2>oAuth connection test failure Office 365</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><p style="margin: 0in; font-size: 12pt; font-family: 'Times New Roman', serif;">IMAP and/or SMPT - Email accounts using Office 365 oAuth authentication are failing connection test.</p></section></div><div ><h3 >Cause</h3><section><p style="margin: 0in; font-size: 12pt; font-family: 'Times New Roman', serif;">Each oAuth connection requires two tokens: an active and a refresh. So, a typical Office 365 configuration will have a total of four tokens. Two for IMAP and two for SMTP. In case where there are multiple tokens for each connection it's possible that such a configuration might cause conflicts and/or corrupt the record.</p></section></div><div ><h3 >Resolution</h3><section><p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11.5pt;">On the instance under investigation. Navigate to System OAuth>Manage Tokens (By typing toke into the navigator) Select Manage Tokens. </span></p> <p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11.5pt;">If it's evident that there are are multiple tokens for each connection, then you should delete all the tokens and reauthorize the instance by performing a Token Refresh. </span></p> <p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11.5pt;">This procedure is covered very well by <a style="color: blue; text-decoration: underline;" title="Configure SMTP and IMAP email accounts with Microsoft Office365 using OAuth2" href="https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0816072">KB0816072</a> Go down to step number six, paying close attention to this line: <br /><strong>You must use an incognito/private window and a local login (side_door.do if needed) to make sure your personal account is not picked up by Microsoft SSO login.</strong></span></p> <p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11.5pt;">Once that's completed, go back, and retry the connection tests. Depending on the results you may propose the solution or continue troubleshooting knowing you've ruled out a very likely cause.</span></p> <p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif;"> </p></section></div></article></div>