You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/08/07 05:46:00 UTC

[jira] [Closed] (OFBIZ-13474) Add OAuth2/XOAUTH2 authentication for outgoing SMTP

     [ https://issues.apache.org/jira/browse/OFBIZ-13474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak closed OFBIZ-13474.
---------------------------------
    Fix Version/s: Upcoming Branch
       Resolution: Fixed

> Add OAuth2/XOAUTH2 authentication for outgoing SMTP
> ---------------------------------------------------
>
>                 Key: OFBIZ-13474
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13474
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework/common
>    Affects Versions: Upcoming Branch
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Major
>             Fix For: Upcoming Branch
>
>
> OFBIZ-13465 migrated OFBiz mail to Jakarta Mail / Eclipse Angus Mail, which supports SASL XOAUTH2 for SMTP. Gmail and Office365 are each moving toward OAuth2 for SMTP auth. Google retired the ["less secure apps" password toggle|https://knowledge.workspace.google.com/admin/sync/transition-from-less-secure-apps-to-oauth?hl=en] for Workspace on 2025-03-14, though App Passwords still work. Microsoft's Exchange Online basic-auth SMTP AUTH goes default-off for existing tenants end of 2026, per [Microsoft's updated deprecation timeline|https://techcommunity.microsoft.com/blog/exchange/updated-exchange-online-smtp-auth-basic-authentication-deprecation-timeline/4489835], with final removal not yet scheduled.
> Add XOAUTH2 as a second supported auth mechanism in {{EmailServices.sendMail}}, alongside existing basic auth — not a replacement for it, since many installs use plain SMTP relays unaffected by either provider's timeline.
> Proposed approach:
> * New encrypted entity {{MailSmtpConfig}} holding all {{mail.smtp.*}} settings (relay/port/starttls/etc., basic-auth user/password, and new OAuth2 fields: client id/secret, refresh token, token endpoint, scope), modeled on the existing {{encrypt="true"}} pattern used by {{firstdatapaymentgateway}}.
> * Per-field fallback to {{general.properties}}/{{SystemProperty}} for full backward compatibility — no forced migration.
> * Access tokens obtained via standard OAuth2 refresh-token grant against a configurable token endpoint (provider-agnostic, no Gmail/Office365-specific code).
> * Initial refresh token is bootstrapped manually (admin obtains it out-of-band, pastes into the entity).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)