[ 
https://issues.apache.org/jira/browse/EMAIL-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17895885#comment-17895885
 ] 

Manuel K commented on EMAIL-163:
--------------------------------

I don't know how many users of this great library are generally using Microsoft 
365 SMTP servers, but many of our users do. Microsoft will turn off basic 
authentication in September 2025, so XOAUTH2 support would be really helpful!

[https://techcommunity.microsoft.com/blog/exchange/exchange-online-to-retire-basic-auth-for-client-submission-smtp-auth/4114750]
[https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth]

Aside from implementing direct support, is there a workaround to already make 
it possible? Maybe by manipulating the Jakarta Mail Session directly? Thanks in 
advance!

> Support for OAuth2 authentication
> ---------------------------------
>
>                 Key: EMAIL-163
>                 URL: https://issues.apache.org/jira/browse/EMAIL-163
>             Project: Commons Email
>          Issue Type: New Feature
>    Affects Versions: 1.4
>            Reporter: Guillaume Grossetie
>            Assignee: Siegfried Goeschl
>            Priority: Major
>              Labels: OAuth2
>
> {quote}
> Starting with JavaMail 1.5.5, support for OAuth2 authentication is built-in 
> and no longer requires SASL (although the SASL OAuth2 support continues to 
> work).
> {quote}
> https://java.net/projects/javamail/pages/OAuth2
> It would be great if commons email could provide an API to support OAuth2 
> authentification.
> The following code should be integrated in {{Email.getMailSession}}:
> {code}
> if (isOAuth2Authentication()) {
>   props.put("mail.smtp.auth.mechanisms", "XOAUTH2");
> }
> {code}
> Or a generic solution:
> {code}
> if (this.authMechanisms != null) {
>   props.put("mail.smtp.auth.mechanisms", this.authMechanisms);
> }
> {code}



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

Reply via email to