EWS - 401 Unauthorized, Fails at New Mail Item. 365 Exchange Online

don3zo 26 Reputation points
2022-01-11T18:21:21.68+00:00

Hello Everyone,

Was wondering if someone could please assist me in figuring out this issue. I am trying to authenticate to:

https://outlook.office365.com/ews/exchange.asmx

However it is not accepting the credentials. It just keeps asking for me to input the credentials after attempting to sign in. After using the connectivity analyzer, it all is successful until it attempts to create a new mail item:

164013-image.png

I have confirmed the following inside 365:

  • MFA is turned off
  • Admin Accounts do not have MFA on
  • Modern and Basic authentication are enabled
  • Credentials are correct (Can login through OWA - outlook.office365.com through browser with no issue)
  • Security defaults are presently turned off

One other thing to note here, is the authenticating account is using the onmicrosoft domain, so any DNS issues should not be present.

If anyone has any ideas, please do let me know and will attempt to fix this thing!

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,171 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,342 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao-MSFT 37,496 Reputation points Microsoft Vendor
    2022-01-12T06:23:35.57+00:00

    Hi @don3zo

    You may use the Basic Auth self-service tool introduced in this link to check if there are some settings blocking basic auth in your tenant:
    Basic Authentication and Exchange Online – September 2021 Update

    And is this account included in Conditional Access policies?
    If yes, please exclude it from the policies and retry.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2 additional answers

Sort by: Most helpful
  1. don3zo 26 Reputation points
    2022-01-14T17:28:52.79+00:00

    Hello everyone,

    This is now resolved. Issue was although Basic Authentication looked like it was turn on at the front end, it actually was not. We had to go through a different method to turn it on through the 365 support option.

    1 person found this answer helpful.

  2. Luis Edgardo de los Santos 0 Reputation points
    2023-04-10T20:30:23.24+00:00

    Hello Muctario, Mediante el portal de azure

    1. Buscar la aplicacion
    2. Hacer clic en API permisssions
    3. Hacer clic en Office 365 Exchange Online
    4. hacer clic en la opcion "Application Permissions"
    5. Hacer clic en "full__access__as_app"
    0 comments No comments