Trouble Setting Up Email Account with OAuth (Office365) – Frappe/ERPNext v15

Hello everyone,

I’m currently having trouble setting up an Email Account with OAuth2 (Office365) in Frappe/ERPNext version 15. I’ve gone through the documentation and tried multiple approaches, including some suggested workarounds I found online, but nothing seems to work.

I’ve already

  • Registered the app with Azure AD.
  • Configured the redirect URI as https://<my-site>/api/method/frappe.integrations.oauth2_logins.login_via_oauth2.
  • Filled in the required fields in the Email Account form (Client ID, Client Secret, etc.).
  • Made sure redirect URI and scopes are set appropriately.

However, when I try to authorize, I either get redirected incorrectly or receive errors that don’t help much in debugging.

Is anyone here successfully using Office365 OAuth2 in Frappe v15? I’d appreciate any guidance or pointers. Even a sample working configuration would be helpful.

Thanks in advance!