Sage 100 OAuth Email settings for Microsoft 365
Resolution
* 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
- Create the app registration if not already completed
- Logon to your Microsoft Azure Portal account (portal.azure.com) as the admin user
- 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
- 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
- Click API permissions / Add a permission / Select Microsoft Graph and then Delegated Permissions
- 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
- Click Grant admin consent for (user) for these permissions
- The new app registration should now be ready for use
- Verify SMTP settings in the Microsoft 365 Admin Center
- Logon to www.office.com as the admin user
- Type admin in the search field and select the Admin app in the search results
- In the Admin Center, click Users / Active Users and select the admin user used to create the App Registration
- Click Mail / Manage email apps
- Make sure the “Authenticated SMTP” checkbox is checked and save changes
- Open the E-mail tab in Sage 100, Library Master, Company Maintenance, and select the OAuth Authentication Method.
- Enter the Address: smtp.office365.com
- Accept default Port: 587
- Accept default SMTP Encryption: TLS
- Enter your User ID: (the email/admin user used to create the App Registration)
- Enter the Client ID for this app registration
- The Client Secret is not required for Microsoft 365
- Enter the Auth endpoint for this app registration
- Enter the Token endpoint for this app registration
- Enter the Scope: https://outlook.office.com/SMTP.Send offline_access
- Enter the Redirect URL used above: https://localhost
- Accept the default Code Challenge Method: S265
- 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