Skip to content

Commit c13f56f

Browse files
Merge pull request #737 from aspelt/Documentation-for-M365-OAUTH-setup
Documentation for M365 OAUTH-setup
2 parents b7ff42b + ec0cc2e commit c13f56f

File tree

3 files changed

+76
-3
lines changed

3 files changed

+76
-3
lines changed

content/tutorials/server/smtp-servers/set-up-oauth-microsoft-365/index.md

+75-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,82 @@ previous-topic: smtp-servers
77
next-topic: smtp-servers
88
---
99

10-
# EHow to implement OAUTH using DNN and Microsoft 365
10+
# How to implement OAUTH using DNN and Microsoft 365
1111

12-
## Placeholder
12+
## Introduction
13+
This page describes the necessary steps to make SMTP work using OAUTH with Microsoft 365.
1314

14-
This is a new page. Tutorial wil follow soon
15+
## Setup steps
16+
1. Check some settings in DNN
17+
2. Create a mailbox in M365 Exchange
18+
3. Create an APP registration in the M365 Azure
19+
4. Grant access to the app to use the mailbox
20+
5. Setup the mailbox in DNN
1521

22+
## 1. Check some settings in DNN
23+
> [!WARNING]
24+
> To avoid errors with the authentication in step 5, make sure that the SSL settings are correct. It must be set on **ON**.
25+
* Personabar - Security - More - SSL Settings: Make sure that SSL Settings = **ON** (/images/scr-m365-oauth-sslsetting.png)
26+
* 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.
1627

28+
## 2. Create a mailbox in M365 Exchange
29+
* Create a mailbox with a licence. Use the address of the site administrator.
30+
* As Admin => Userdetails - E-mail - E-mail apps: In the account settings ensure that the option *Verified SMTP* is enabled.
31+
32+
> [!WARNING]
33+
> 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`
34+
35+
> In Powershell ISE:
36+
> * Install-Module -Name ExchangeOnlineManagement
37+
> * Connect-ExchangeOnline -Organization [TENANTID]
38+
> * Set-CASMailbox -Identity [login-address] -SmtpClientAuthenticationDisabled $false
39+
40+
41+
## 3. Create an APP registration in the M365 Azure
42+
Create an **App registration** (portal.azure.com -> App registrations)
43+
* Give it a name and choose the **single tenant** option
44+
* In the left menu -> Manage - Authentication and choose **Add a platfom** => **web**:
45+
* enter your domainname
46+
* In the left menu -> Manage - Authentication and choose **Add redirect URIs**:
47+
* https://[SITEURL]/Providers/SmtpOAuthProviders/ExchangeOnline/Authorize.aspx
48+
* https://[SITEURL]
49+
* In the left menu -> Manage - Certificates and Secrets
50+
* Choose **New client secret**:
51+
* Create a secret and save your key for later use.
52+
* In the left menu -> Manage - API permissions and choose **Add a permission**:
53+
* Select **Microsoft Graph** -> Delegated -> SMTP.Send (Send emails from mailboxes using SMTP AUTH) -> Add permission
54+
* Select **APIs my organisation uses** -> Office 365 online -> Application permissions ->
55+
56+
* In the left menu > Overview
57+
* Copy the **Directory (tenant) ID** for later use
58+
* Copy the **Application (client) ID** for later use
59+
60+
## 4. Grant access to the app to use the mailbox
61+
**In Azure:**
62+
* Search for **Enterprise applications**
63+
* Search for application
64+
* Copy the **Application ID**
65+
* Copy the **Object ID**
66+
67+
**In Powershell ISE:**
68+
* Install-Module -Name ExchangeOnlineManagement
69+
* Connect-ExchangeOnline -Organization **[TENANTID]**
70+
* New-ServicePrincipal -AppId **[Application ID]** -ObjectId **[Oject ID]**
71+
* Get-ServicePrincipal | fl
72+
* Copy the value of **SID**
73+
* Add-MailboxPermission -Identity "[mailaddress]" -User [SID] -AccessRights FullAccess
74+
75+
## 4. Setup the mailbox in DNN
76+
* Personabar - Servers - Server settings
77+
* SMTP authentication:
78+
* SMTP Authentiaction: **OAUTH**
79+
* Auth Provider: **Exchange Online**
80+
* Tenant id: **[Your Tenant ID]**
81+
* Client id: **[Your Client ID]**
82+
* Client Secret: **[Your Secret]**
83+
84+
* Click **Authorize**
85+
* Enter your mailbox user credentials
86+
* Click **Test SMTP Settings** to check if the setup is successful.
87+
88+
> **Your OAuth provider's configuration has been completed.**

content/tutorials/toc.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
##[Maintenance](xref:menu-placeholder)
1010
###[Server Performance](xref:server-performance)
1111
##[SMTP Servers](xref:smtp-servers)
12+
###[SMTP OAUTH Microsoft 365](xref:set-up-oauth-microsoft-365)
1213

1314
#[Sites](xref:sites)
1415
##[Managing Sites](xref:administrators-sites-overview)

images/scr-m365-oauth-sslsetting.png

48.5 KB
Loading

0 commit comments

Comments
 (0)