[Tutorial] Connecting Frappe/ERPNext to Microsoft 365 mail services OAuth

Hi @avc,

thanks. Your tip helped me fixing the issue. It works now :wink:

Do you have an idea how long the authorisation lasts? Do we have to frequently reauthorize by clicking on “Authorize API Access”?

Regards

Kevin

In my case the redirect uri shows http instead of https due to which it shows error AADSTS50011: The redirect URI ‘http://********/api/method/frappe.integrations.doctype.connected_app.connected_app.callback/ef8fae62a1’ specified in the request does not match the redirect URIs configured for the application ‘3d52677d-a705-471e-8265-915c78ad871e’. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal.

Please help me it really urgent

Hi @sumeet_sharma sumeet:

Are you pointing to the right M365 registration app?

Yes, I am doing it correctly

The issue is with the Connected App where the redirect URI is showing http instead of https.

Hi @sumeet_sharma:

Maybe connected app was created before install ssl certificate?
Check your host name in site_config.json, maybe is not https …

Create connected app again or change redirect_uri value directly on db, something like this:

update `tabConnected App`
set redirect_uri="https://yourredirecturi ..." where name="yourappname"

(be careful)

Hope this helps.

In host name site_config.json, its https:// only

Ok, set host_name as “https://yoursite.com” and try to create connected app again. redirect_uri gets host_name from site_config

I have done everything now its working but while clicking on authorize API Access, it says the page cannot be displayed or refuse to connect.

While clicking on Authorize API Access it displays

I am bogged down at this section in ERP where I need to get an OPENID configuration. Where is this with the cloud base software?

Looking for a little assistance.
I managed to get all the steps done up to 2.b.7 (Create An Email Account), but when creating the Email Account, I don’t get the option to “Authorize API Access” button, it’s simply not there.
Am I doing something wrong that would cause the API Button to not appear?

Hi @jroyDC:

Link to connected app and user, save and button must be shown …

Hope this helps.

Hello @avc,

i disable SMTP Auth within mailflow setting but get these error?
What can i do to fix these issue? If i only enable IMAP within mail account settings for specific User i don´t get any error.

image

Regards
Kevin

HI @kevco97:

Check credentials and make sure SMTP AUTH is enabled for your tenant in M365 (Exchange) admin panel.

Hello @avc,

it´s enabled.

image

Regards
Kevin

Check if this mailbox (user) has smtp enabled too (email apps on user config)
image

@avc,

yes i have check.

Fixed that was the issue i was logged in on the MS365 Website with different User :smiley:

Thank you for your help.

Regards
Kevin

1 Like