Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » How to send email with OAuth (merged) (Oracle, 12.1, Enterprise Edition, Linux)
How to send email with OAuth (merged) [message #686448] Thu, 15 September 2022 01:10 Go to next message
praveenpraj
Messages: 21
Registered: October 2011
Location: India
Junior Member
Presently we are sending emails (Office 365) from database using UTL_SMTP.
Now as microsoft is going to discontinue basic authentication for SMTP, POP, IMAP etc., and forcing Modern authentication - OAuth 2.0,
how we authenticate using OAuth through existing PLSQL procedure which is using UTL_SMTP.
Re: How to send email with OAuth [message #686451 is a reply to message #686448] Fri, 16 September 2022 13:35 Go to previous messageGo to next message
Alien
Messages: 292
Registered: June 1999
Senior Member
Hi,

it depends on whether you already have an access token that you can use, or if you need to establish the full credential flow from the RDBMS.
In either case, UTL_SMTP.COMMAND allows you to send an AUTH, XOAUTH2 command followed by the access token. That takes care of the SMTP part.

If you need the full credentials flow, the best option is to use ORDS. In the relevant versions it has native OAUTH2 support packages. Use ORDS to get an access token, and the SMTP commands as indicated by Microsoft.

Regards,

Arian
Re: How to send email with OAuth [message #686754 is a reply to message #686451] Tue, 13 December 2022 08:32 Go to previous messageGo to next message
Paperogi
Messages: 1
Registered: December 2022
Junior Member
Hi,

<< the best option is to use ORDS. In the relevant versions it has native OAUTH2 support packages. Use ORDS to get an access token >>

But how we can use ORDS (and packages supporting OAUTH2) against real authentication service we have to use, that is Microsoft Identity Platform ?

I suppose that OAuth2 of ORDS has its own authentication service ...

Thank you for reply.

Re: How to send email with OAuth [message #689074 is a reply to message #686451] Thu, 14 September 2023 20:31 Go to previous message
Oracle Alex
Messages: 1
Registered: September 2023
Junior Member
hi do you have an example of how you send a token using UTL_SMTP ? I already have the token but can't find a way to connect with the smtp.office365.com server using oracle as the only authentication method accepted is XOAUTH2
Previous Topic: arabic translation of customer tracker productivity appp in Apex (3 merged)
Next Topic: Oracle APEX on tomcat "App Unavailable"
Goto Forum:
  


Current Time: Wed Dec 11 13:58:38 CST 2024