How can we help?

How to Fix "Token connection failed. Reason: access_denied" Error for Microsoft 365 Incoming Email Accounts in LiveAgent

This article explains how to resolve the error "Token connection failed. Reason: access_denied" that may appear when a connected Microsoft 365 incoming email account stops fetching new emails in LiveAgent.

Possible Causes

  • IMAP is not enabled in the Microsoft 365 admin settings.
  • The OAuth token used to authenticate the connection has expired or become invalid.
  • The IMAP connection settings (host or port) have been changed after the account was initially connected.

Step 1: Verify That IMAP Is Enabled in Microsoft 365

Before attempting to reconnect the account, confirm that IMAP access is enabled for the affected mailbox in your Microsoft 365 admin settings:

  1. Sign in to the Microsoft 365 Admin Center.
  2. Navigate to Users > Active users and select the affected user.
  3. Go to the Mail tab and click Manage email apps.
  4. Ensure that IMAP is checked/enabled.
  5. Save any changes if needed.

Step 2: Reconnect the Email Account in LiveAgent

If IMAP is already enabled, or after enabling it, try reconnecting the account to refresh the OAuth token and re-establish the IMAP session:

  1. In LiveAgent, navigate to Configuration > Email > Incoming Mail Accounts.
  2. Locate the affected Microsoft 365 account and open its settings.
  3. Disconnect and then reconnect the account using the Microsoft OAuth connector.
  4. Follow the Microsoft authorization pop-up to grant the required permissions.

Step 3: Re-integrate the Account if Connection Settings Have Changed

If any IMAP connection details — such as the host or port — have been modified since the account was first connected, simply reconnecting will not be sufficient. In this case, you must delete the email account and reconnect it from scratch.

For detailed instructions, refer to the article: Re-integrating Email Accounts after Host or Port Changes.

Additional Notes

If your organisation enforces admin approval for third-party app integrations, a Microsoft 365 administrator must grant consent for LiveAgent to access the mailbox. Refer to the Microsoft documentation on granting admin consent for details.

Verify that the correct IMAP server settings are used when reconnecting:

  • IMAP server: outlook.office365.com
  • IMAP port: 993
  • Encryption: SSL/TLS
  • Authentication method: OAuth2 / Modern Auth

Still Having Issues?

If the problem persists after following all the steps above, please contact the LiveAgent support team for further assistance. Our team will be happy to help you investigate the issue further.

How to Fix "Token connection failed. Reason: access_denied" Error for Microsoft 365 Incoming Email Accounts in LiveAgent