Skip to content

Commit

Permalink
Merge pull request #740 from aspelt/Polish-and-corrections-and-SMPT-O…
Browse files Browse the repository at this point in the history
…ATH-page

Small corrections and polish to setup oauth smtp for M365
  • Loading branch information
valadas authored Feb 20, 2025
2 parents 1f7be4e + 336fd40 commit ca5e69e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ This page describes the necessary steps to make SMTP work using OAuth with Micro
## 1. Check some settings in DNN
> [!WARNING]
> To avoid errors with the authentication in step 5, make sure that the SSL settings are correct. It must be set on **ON**.
* Personabar - Security - More - SSL Settings: Make sure that SSL Settings = **ON** (/images/scr-m365-oauth-sslsetting.png)
* Personabar - Security - More - SSL Settings: Make sure that SSL Settings = **ON**
![Alt text](/images/scr-m365-oauth-sslsetting.png "SSL settings")

* Personabar - Security - Login settings: Check the site administrator account. You need to use this e-mail address in M365, because the site administrator is the sender.

## 2. Create a mailbox in M365 Exchange
* Create a mailbox with a licence. Use the address of the site administrator.
* As Admin => Userdetails - E-mail - E-mail apps: In the account settings ensure that the option *Verified SMTP* is enabled.

> [!WARNING]
> [!NOTE]
> In the tenant settings Verified SMTP is not always enabled. You can enable this option for a user with the Powershell command: `Set-CASMailbox -Identity [login-address] -SmtpClientAuthenticationDisabled $false`
> In Powershell ISE:
> In Powershell:
> * Install-Module -Name ExchangeOnlineManagement
> * Connect-ExchangeOnline -Organization [TENANTID]
> * Set-CASMailbox -Identity [login-address] -SmtpClientAuthenticationDisabled $false
Expand All @@ -53,6 +55,11 @@ Create an **App registration** (portal.azure.com -> App registrations)
* Select **Microsoft Graph** -> Delegated -> SMTP.Send (Send emails from mailboxes using SMTP AUTH) -> Add permission
* Select **APIs my organisation uses** -> Office 365 online -> Application permissions ->

> [!NOTE]
> Grant admin consent
![Alt text](/images/scr-m365-oauth-permissions.png "Grant admin consent ")


* In the left menu > Overview
* Copy the **Directory (tenant) ID** for later use
* Copy the **Application (client) ID** for later use
Expand All @@ -64,7 +71,7 @@ Create an **App registration** (portal.azure.com -> App registrations)
* Copy the **Application ID**
* Copy the **Object ID**

**In Powershell ISE:**
**In Powershell:**
* Install-Module -Name ExchangeOnlineManagement
* Connect-ExchangeOnline -Organization **[TENANTID]**
* New-ServicePrincipal -AppId **[Application ID]** -ObjectId **[Oject ID]**
Expand Down
Binary file added images/scr-m365-oauth-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca5e69e

Please sign in to comment.