How email using OAuth and Exchange Online
philip.tulett at pdq-networks.com
Tue Jul 12 08:36:03 UTC 2022
I have multiple apps that are connecting to Exchange / O365 to send and retrieving messages using ow3 objects.
>From what you have said, you are just sending emails, at this time MS are continuing to support Basic Auth for SMTP Sending:-
That said, if you are going to refactor the code to use the new worker object, it would be worth going to OAUTH at the same time.
Generally, MS tokens have a life of about an hour, so expect to receive an updated token at that rate, that will need to be saved for next connection, so capture the call to $tokensrefreshed and then save the OAUTH buffer using Do iOAUTH2.$save(iSavedOAUTHBuffer,iKey) Returns lOK
I encrypt the OAUTH buffer with a key, then save it to a binary field in the database so can be used at the next call or if the apps stops and restarts.
So, when starting a connection, I load the latest OAUTH buffer from the database.
To reduce user interaction/reauthorisation, when setting up the in AZURE, include the following tin the Scope API:-
I my case I also include
The above will need to be include in your initial Authorization request
If you have multiple servers that could perform the token refresh, make sure that you include them in all the Redirect URI's in AZURE.
If you will be using the Omnis Runtime's I recommend setting a unique static port for each of them (see above on Redirect URI's) in their server options "RESTful connections"
From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> On Behalf Of Michael Houlberg
Sent: 11 July 2022 19:07
To: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Subject: Re: How email using OAuth and Exchange Online
Thanks, I’m sure I’ll be talking with you in the future. I see that right now I should probably make the move from SMTPSend to oSMTPWorker as a first step, since I already know how to do that.
Houlberg Development, LLC
> On Jul 11, 2022, at 11:04 AM, Mike Matthews - Omnis via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> I’m in the middle of using oAuth2 for Exchange / O365 / Azure.
> Most done, just need to tidy up.
> Mike Matthews
> Lineal Software Solutions
> Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple,
> Devon, EX31 1EU<x-apple-data-detectors://1/1>
> omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>
> On 11 Jul 2022, at 18:55, Michael Houlberg <michael at houlbergdevelopment.com<mailto:michael at houlbergdevelopment.com>> wrote:
> My client who is part of a University, tells me that this fall they are dropping support for the type of email we have been using in favor of Exchange Online and using OAuth to authenticate. Currently we send lots of emails using SMTPSend. For another client I have had experience using the oSMTPWorker object. But I haven’t had to deal with either oAuth or Exchange Online Server.
> Does anyone have some pointers on this they can share?
> Michael Houlberg
> Houlberg Development, LLC
> Manage your list subscriptions at
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
> Manage your list subscriptions at https://lists.omnis-dev.com Start a
> new message -> mailto:omnisdev-en at lists.omnis-dev.com
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en