XOAUTH2 configuration with Microsoft

Hello community,

I would like to confirm if anyone has successfully configured moderate authentication in OJS 3.3.x with Microsoft. I have tried the configuration, but there is always a problem with what is stated in Mail.inc.php
I have also tried configuring XOAUTH2 with Google, and after a long time, I was able to configure it successfully.
My application is OJS 3.3.0-21, with PHP 7.3.

Thank you for any experience and/or comments. Best regards,

Hello community,

In case anyone needs the final comment, yes, modern authentication could be configured in this version of OJS. In general, the following steps were followed.

The email account administrator must perform the following steps:

  1. Register the application (App Registration)
  2. Create the client_secret
  3. Permissions (API permissions)
  4. Verify SMTP AUTH in the tenant/mailbox
  5. Obtain the authorization code (to generate the refresh_token)
  6. Exchange the code for tokens (the refresh_token is generated)

The platform server administrator must perform the following steps:

  1. Paste into OJS (config.inc.php)

smtp=On
smtp_server=smtp.office365.com
smtp_port=587 smtp_auth=tls
smtp_authtype=XOAUTH2
smtp_oauth_provider=Microsoft

smtp_oauth_clientid= ***
smtp_oauth_refreshtoken=***
smtp_oauth_tenant=***

allow_envelope_sender=On
force_default_envelope_sender=On
force_dmarc_compliant_from = On

In addition, the Mail.inc.php file in lib/pkp/classes/mail/Mail.inc.php must be adjusted to accept Microsoft’s configuration rather than Google’s.

I hope these comments are helpful to someone. Best regards,

Hi @aracelihmx,

Thanks, that’s very helpful to know; would you be able to document the changes to Mail.inc.php that were required for Microsoft’s OAuth service?

Regards,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 25 days. New replies are no longer allowed.