More and more mail servers, including Google and Microsoft, are adopting the advanced OAuth 2.0 security authorization mechanism to authenticate mail clients. Unlike traditional username/password authentication, OAuth authorization requires identity verification through a third-party application. Vigor Router supports this mechanism, enabling it to send notification emails via such mail servers.
OAuth 2.0 Flow Process
This article introduces how to configure a Vigor Router to use OAuth 2.0 to send notification emails through the Microsoft mail server.
Supported Models and Firmware Versions
1. Configure Dynamic DNS
Navigate to Applications >> Dynamic DNS Setup >> Dynamic DNS Account Setup.
In this example, DrayDDNS is used. This DDNS name will later be used in the Microsoft Server Redirect URI.
2. Enable HTTPS from WAN
Navigate to System Maintenance >> Management
Vigor Router acts as the OAuth client and needs to request an access token from the Microsoft authorization server before sending emails. The HTTPS management port must be set to 443 for OAuth 2.0 functionality.
3. Configure Microsoft Entra ID
To allow Vigor Router to use Microsoft OAuth 2.0 authentication, create an application in Microsoft Azure Portal / Microsoft Entra Admin Center.
3.1 Create an App Registration
Sign in to the Microsoft Entra Admin Center and navigate to Identity → Applications → App registrations → New registration
Recommended Settings
| Item | Value |
|---|---|
| Name | Router SMTP OAuth |
| Supported account types | Single tenant |
| Redirect URI | Leave blank initially |
After creating the application, record the following:
3.2 Create a Client Secret
Navigate to Certificates & secrets → New client secret
Create a new client secret.
3.3 Add SMTP OAuth Permissions
Navigate to API permissions → Add permission
Select:
Add the following permissions:
For Router / IoT implementations, delegated permissions with refresh token support are recommended.
3.4 Grant Admin Consent
Navigate to API permissions → Grant admin consent
Click: Grant admin consent
3.5 Configure Redirect URI
Navigate to Applications → App registrations → Your App → Authentication
Under Redirect URIs, add the router URL.
Example:
https://oauth2.drayddns.com/doc/mailOAuth.htm
4. Configure Mail Service on Vigor Router
Access the Vigor Router using the HTTPS DDNS address created in Step 1.
Navigate to Objects Setting >> SMS/Mail Service Object
Select a profile index and configure the following:
A Microsoft authentication window will appear. Choose the Microsoft account and proceed with authorization.
Click Accept to grant permission for the router to use the Microsoft API.
Once completed, the Vigor Router will successfully obtain the OAuth token from the Microsoft server.
5. Send a Test Email
Use Send a Test E-mail to verify that the Vigor Router can send emails through the Microsoft server using OAuth 2.0 authentication.
6. Configure Notification Objects
After confirming that the test email is received successfully, configure the notification objects and Mail Service settings. Once completed, the Vigor Router will be able to send notification emails through Microsoft 365 using OAuth 2.0.
7. Disable HTTPS from WAN
Navigate to System Maintenance >> Management
Disable HTTPS from WAN after OAuth token acquisition is completed.
The initial OAuth authorization process requires WAN HTTPS access temporarily because the router must receive the OAuth callback through the configured domain name.
Once the token is obtained, the Vigor Router stores the token locally and uses it for subsequent HTTPS requests directly to the Microsoft server. These requests will pass the Access List security checks normally.