How to configure API for SMTP Auth for shared e-mail on Microsoft 365

Brian Sump 6 Reputation points
2022-03-12T18:59:57.457+00:00

Our company runs our e-mail through Microsoft 365. We have a shared e-mail that we would like to use for automated messaging, the equivalent of no-reply@keyman .com. I am attempting to follow the instructions here to implement this requirement. I am using OAuth v2 for authentication, and am trying to implement the SMTP Auth methodology.

Unfortunately, I am having problems in two respects:

  1. I am receiving an error ServerError: invalid_scope: 1002012 - [2022-03-11 20:04:47Z]: AADSTS1002012: The provided value for scope https://outlook.office.com/SMTP.Send openid profile offline_access is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI).

My scope is setup: const tokenScopes = ['https://outlook.office.com/SMTP.Send']; This was setup from instruction found here. Maybe there is a problem with the permissions I've given my client, in which case when I do app registration, what permission do I need to ensure that my App has in order to be granted SMTP access?

  1. When I try to enable SMTP on my mail box following the instructions here, the mailbox doesn't have the referenced mail apps section, and instead there is a note that this is not an officially licensed account (because it is a shared account). Is there an alternate way to provide SMTP access to this account?

Any help would be appreciated.

Exchange | Exchange Server | Management
Microsoft 365 and Office | Development | Microsoft 365 Publishing
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.