Sending Emails via OAuth2 Authentication for Microsoft Office 365
Administrative emails are sent by yuuvis RAD®’s core-service component. Since Microsoft stopped the support for basic authentication for Azure email accounts, yuuvis RAD® supports authenticating via OAuth2 protocol since version 9.12.
To enable OAuth2 authentication for the core-service, follow the instructions in the following sections:
Azure Configurations for User and App Registration
Setup OAuth2 support for the desired user account:
Open or create desired user-account.
Activate SMTP Auth for the user by navigating to E-Mail > Manage E-Mail-Apps and setting the check mark at Authenticated SMTP.
Create an app registration:
Create a new app registration by navigating to Identity > Applications > App registrations and select +New registration.
Select a descriptive name and set the Redirect URI to “Web“ and “http://localhost”.
Setup a secret for the App registration:
In the App registration blade, navigate to Certificates & secrets.
Select +New client secret.
Enter a description, choose an expiration date and select Add (make a note of the Value – we refer to it as “Client Secret”).
Grant API permissions:
Go to API permissions in the App registration blade and select Add a permission.
Navigate to APIs my organization uses > Office 365 Exchange Online > Application permissions > SMTP and check SMTP.SendAsApp.
Grant admin consent for the permission.
Go to Overview and make a note of Application (client) ID and Directory (tenant) ID.
Select enterprise application:
Navigate to Identity > Applications > Enterprise applications and select the newly created application.
Make a note of the Object ID displayed under Overview.
Under Users and groups, add the desired user.
Configurations for Exchange (Online) via Windows Powershell
Install the Exchange Online Management Module in Powershell (if not already installed):
Open Windows Powershell
Make sure the ExecutionPolicy is set to „RemoteSigned“:
Get-ExecutionPolicy Set-ExecutionPolicy RemoteSigned
Install PowerShellGet:
Install-Module -Name PowerShellGet -Force
Install Exchange Online Management cmdlet:
Install-Module -Name ExchangeOnlineManagement #(for all users)
OR
Create a ServicePrincipal and setup permissions in Exchange Online:
Open Windows Powershell
Connect to Exchange Online:
Create ServicePrincipal (Important! Use the ObjectID from the Enterprise Application):
Set mailbox permissions:
yuuvis RAD® Configuration in the management-studio
Navigate to the settings page: On the lower half the email configuration is shown.
Make the following changes in the SMTP authentication method section:
Set the check mark at SMTP authorization enabled.
Choose OAuth2 Microsoft Office in the Authentication method drop-down menu.
Enter the Client-ID, the ClientSecret and the Tenant-ID (Directory-ID) in the corresponding text fields in the OAuth2 Microsoft Office section.
Click the save button. Configuration is complete.
You can test the configuration by starting the Test e-mail settings action from the menu at the top right.