Error 401 when starting Outlook Web Add-in sample

Pascal Wüthrich 20 Reputation points
2024-04-16T12:19:48.7233333+00:00

I added a new default project for "Outlook Web Add-in" in Visual Studio Community 2022.

On starting the sample project I have to enter my credentials for "Connect to Exchange email account".

After push the [Connect] button I get back an error window indicationg that "An error occured while connecting to the server: The request failed. The remote server returned an error: (401) Unauthorized."

Any hints where I do have to look at?

Best regards,
Pascal

Outlook
Outlook
A family of Microsoft email and calendar products.
2,988 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,499 questions
{count} votes

Accepted answer
  1. SamRamon-6302 81 Reputation points
    2024-04-17T22:32:38.97+00:00

    If your tenant requires multi-factor authentication, you'll need to perform the following steps to connect to your Exchange email account:

    1. Navigate to your add-in project's properties. It should appear below Solution Explorer by default, but if it doesn't appear there, select your project from Solution Explorer, then select F4 or View > Properties Window.
    2. In the Deployment section, set the Use multi-factor auth property to True.

    Your tenant sign-in page should appear when you run your project. For additional information, see Build your first Outlook add-in.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful