Trying to get Oauth2 with Microsoft 365 working, tried the authentication guide to no avail.

  1. enter the Oauth2 details and get: mailbox: OAuth2 Authorization Successful
  2. click save and get AUTHENTICATE failed

Account settings

Hostname: outlook.office365.com
Port number: 993
Folder: Support
Protocol: IMAP
Authentication: OAuth2 - Microsoft

Below is the oauth2 settings:

Callback Endpoint https://hidden.url/api/auth/oauth2
Client Identifier (Id): hidden.id
Client Secret: hidden.secret
Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token
User Details URL: https://outlook.office.com/api/v2.0/me
Scopes: offline_access https://outlook.office.com/Mail.ReadWrite
Email Address Attribute: EmailAddress

Any assistance would be appreciated.

    wilbur79

    Are you sure your Endpoints are /common/? Usually thats if you configured the app as multi-tenant.

    Also, when you look at the Token tab in the Authentication Config popup, does the Resource Owner match the email address in question?

    Did you Add and provide Admin Consent to the correct API permissions?

    Cheers.

      2 years later
      Write a Reply...