Hi
As Microsoft ist deprecating SMTP access with username and password to Exchange Online beginning next year, I am trying to get the new XOAuth SMTP configuration to work.
Unfortunately I am still not succeeding with the help of the documentation in Server Administration Guide.
Whereas I am able to send E-Mails with a Powershell script using Graph API, it is still not working in Keycloak
Keycloak gets an access token. The mail sending results always in an “Caused by: jakarta.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [ZR0P278CA0053.CHEP278.PROD.OUTLOOK.COM 2025-09-20T08:24:41.590Z 08DDF7D32B280557]“ error.
My configuration is:
Host: smtp.office365.com
Port: 587
Encryption: StartTLS
Auth Token URL: https://login.microsoftonline.com/xxxxxxx/oauth2/v2.0/token
Auth Token Scope: https://outlook.office365.com/.default
Was anyone successful with this and can help me?
Kind regards
Dieter