Skip to content
logo Knowledgebase

How to configure Sage 100 OAuth E-mail settings for use with a Microsoft 365 App Registration

Created on  | Last modified on 

Summary

How to configure Sage 100 OAuth E-mail settings for use with a Microsoft 365 App Registration.

Description

Cause

Resolution

CAUTION: Sage Customer Support does not assist with issues related to third-party products or enhancements, hardware, report customizations, state or federal tax-related questions, or specific accounting questions. Please get in touch with your Sage business partner, network administrator, or accountant for assistance. Please refer to our Scope of Support document for details.

Note: Sage Customer Support cannot assist setting up OAuth Authentication to connect to various SMTP Mail Servers.

This information is provided to assist Sage 100 Business Partners or Customers familiar with the SMTP (Mail) Server being used.

While Sage cannot provide guidance for all SMTP Server configurations, the following is an example, and to be used as guidance, on how to connect Sage 100 to Microsoft 365 using OAuth

Please consult with your Sage 100 Business Partner or Sage City if you are not familiar with SMTP (Mail) Server setup.

* A minimum of Sage 100 2022.1 or Sage 100 2021.4 must be installed and if using Advanced or Premium, LM7101T (2022.1) or LM7012T (2021.4) must also be installed. Sage 100 2022.2 and Sage 100 2021.5 include these hotfixes.

*Note: .NET 4.8 is also required . See link in related resources to determine if .NET 4.8 is installed

  1. Create the app registration if not already completed
    1. Logon to your Microsoft Azure Portal account (portal.azure.com) as the admin user
    2. Go to Azure Active Directory / App Registrations and click New Registration
      • Enter the Display Name: (user-defined)
      • Select Who can use: Single tenant
      • Enter the Redirect URI: (Platform = Public client/native) https://localhost
    3. Click Register
      • Tip: copy the Application (client) Id and save it for later reference
      • Tip: click Endpoints and copy the Authorization endpoint (v2) and the Token endpoint (v2) for later use. Then Close Endpoints
    4. Click API permissions / Add a permission / Select Microsoft Graph and then Delegated Permissions
    5. Select the offline_access and SMTP.Send permissions and then click Add permissions
      • There should be 3 permissions at this point: offline_access, SMTP.Send, User.Read
    6. Click Grant admin consent for (user) for these permissions
      • The new app registration should now be ready for use
  2. Verify SMTP settings in the Microsoft 365 Admin Center
    1. Logon to www.office.com as the admin user
    2. Type admin in the search field and select the Admin app in the search results
    3. In the Admin Center, click Users / Active Users and select the admin user used to create the App Registration
    4. Click Mail / Manage email apps
    5. Make sure the "Authenticated SMTP" checkbox is checked and save changes
  3. Open the E-mail tab in Sage 100, Library Master, Company Maintenance, and select the OAuth Authentication Method.
    1. Enter the Address: smtp.office365.com
    2. Accept default Port: 587
    3. Accept default SMTP Encryption: TLS
    4. Enter your User ID: (the email/admin user used to create the App Registration)
    5. Enter the Client ID for this app registration
    6. The Client Secret is not required for Microsoft 365
    7. Enter the Auth endpoint for this app registration
    8. Enter the Token endpoint for this app registration
    9. Enter the Scope: https://outlook.office.com/SMTP.Send offline_access
    10. Enter the Redirect URL used above: https://localhost
    11. Accept the default Code Challenge Method: S265
    12. Click Accept to save the company record and then click Test Email to initiate the authentication process

Note: On the initial auth process, a user interface is launched where you will be prompted for the user and password. After that the system will use a token and a refresh token to send SMTP emails without user interaction. This will continue if emails are sent from the company at least every 90 days. However, after 90 days of inactivity, the refresh token will expire which will cause the UI to launch again, stopping the email send, and require the user and password.

  • Note: This refresh token expiration is specific to Microsoft 365 and may vary with other providers.
  • Note: If your email provider and/or user id is unchanged on the E-mail tab in Company Maintenance,review and verify the “From” e-mail addresses entered in Paperless Office / Setup / Form Maintenance.
  • Note: If your email provider and/or user id is changed on the E-mail tab in Company Maintenance, verify the “From” e-mail addresses entered in Paperless Office / Setup / Form Maintenance are valid email aliases

DocLink: Using OAuth 2.0 with Sage 100
DocLink: Will Sage 100 lose ability to send emails thru Paperless Office once Microsoft disables Basic Authentication
DocLink: Error: "The Authentication process failed."
DocLink: Error: "Your e-mail was not sent because an error has occurred"
DocLink: How to determine if .NET 4.8 is installed on workstation