Configure an OAuth application profile to authenticate using certificates for outbound email.
Before you begin
Create an Microsoft Azure account to configure an OAuth profile.
Complete the setup steps using your Microsoft Azure Developer account. See Microsoft Azure product documentation for instructions on creating and configuring custom applications.
Role required: Microsoft Azure portal administrator and admin
Procedure
-
Log in to the Microsoft Azure registration profile with your organization credentials.
-
Register a new custom application by filling in the application name, supported account type, and redirect URL, and then select Register.
Note: Enter the redirect URL in the following format: https://<instance>/oauth_redirect.do.
An overview of the application's basic information is displayed.
-
Copy the client ID to a text file.
You’ll use this client ID and the secret value generated in the next steps to register the app as a third-party OAuth provider on your ServiceNow instance. You use the application ID as the client ID when you connect the application to ServiceNow.
-
Enable the SMTP.SendAsApp permission.
-
In Microsoft Azure, navigate to .
-
Select Add a permission.
-
Select the Microsoft Office 365 tile.
-
Select Application Permissions.
-
In the Select permissions field, enter SMTP.SendAsApp.
-
Select the SMTP.SendAsApp check box.
-
Select Add permissions.
-
Select Grant admin consent for <organization name>, then select Yes to confirm.
-
Upload the certificate.
-
In Microsoft Azure, navigate to .
-
Select upload certificate.
-
Provide a description, a start date, and an expiration date, then upload the certificate.
-
Copy the client ID and directory ID to a text file.
-
Register service principals in Microsoft Exchange using PowerShell.
-
Run the following commands.
Install-Module -Name ExchangeOnlineManagement -allowprerelease
Import-module ExchangeOnlineManagement
Connect-ExchangeOnline -Organization <tenantId>
For more information, see
Authenticate SMTP connection using OAuth
-
Register an Microsoft Entra ID application's service principal by running the following command.
New-ServicePrincipal -AppId <APPLICATION_ID> -ObjectId <OBJECT_ID>
Important: For the OBJECT_ID value, go to and copy the Object ID.
-
Add permission to user email ID using the following command.
Add-MailboxPermission -Identity "<email_id>" -User <object_id> -AccessRights FullAccess
-
Navigate to and copy the OAuth 2.0 token endpoint (v2) to a text file.
You use the
OAuth 2.0 token endpoint (v2) when configuring a JWT provider. For more information, see
Configure a JWT provider.