NodeRed and OAuth2

Hello, everyone,

I've been using Node-Red (v3.0.2) for a long time and everything has worked fine so far.
Now I am faced with the problem that I can no longer access my emails via the email node since oauth2 was introduced in Outlook. Does anyone know this problem and has a solution ready?

thanks for your help

I think you need to get an application password:

Hi, thanks for your reply. So if I understand correctly, all I have to do is create the application password and use that as the new user password in the email node?

Been a while since I tried but basically I believe that is the approach, yes.

I created an Application Password and used it as the new user password. Unfortunately it doesn't work that way. I have attached a picture of the config with my parameters. Have you already solved the problem with OAuth2 yourself in this way? Do you see an error in my parameters? Is it correct to use IMAP?

Thanks for your help.

I have done it in the past but not recently I'm afraid. I know that Microsoft made a fair few changes in January so I don't know if that has impacted things.

I assume this is a personal account rather than Office 365 business/enterprise?

I am in the same boat, and found this:

Microsoft Basic Auth Deprecation

It's been in the pipeline for years apparently. The new method is OAuth2.0, which is not supported by the email node yet. I am going to request this feature and make a pull request on the repo - I think many people will be crying out for this shortly.

In the meantime, I think you can achieve IMAP access by using http request nodes and manually sending the commands to server along with a valid token. The process on the Office 365 side as described by Microsoft is here:

Using OAuth to Authenticate IMAP, POP, or SMTP

Thanks for your reply.
ok, i think you probably had enough time to prepare for the change, i missed that :smiley: I hope there will be support for it soon.

Have you already done something that I could use as a guide? Unfortunately I don't have the knowledge to implement it.

I have a working version now after making some changes to the email node, and using the node-red-contrib-oauth2 node. I've linked the fork on this thread. Just trying to follow the guidelines before I do a pull request!

The most complicated part of this process by far was the PowerShell component to get the service principles linked up - but at this stage, we don't really have other options. I hope Microsoft realize that we've gone to the other extreme and eventually come to the party to make things a little easier.

For now though, this guide was the most useful. Follow those steps and then check to see if the email node is updated yet. I don't mind you using the one from the fork, but bear in mind that although it's working, it isn't finished yet.


Yes - as per other thread - a PR would be most welcome.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.