Solution: Due To A Configuration Change Made By Your Administrator While Connecting To SharePoint Online Tenant Using PnPjs

Introduction

Recently, I got the below error while I was connecting to SharePoint Online Tenant using PnPjs.

Error message

Connect-PnPOnline: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000003-0000-0ff1-ce00-000000000000'.

How to fix Error

Let's see the steps to resolve this error.

Solution

Step 1

Go to https://portal.azure.com/#home

Step 2

Search for Azure Active Directory.

How to fix Error

Step 3

Once you are in the Azure Active Directory pane, click on Properties in the left navigation menu.

How to fix Error

Step 4

On the Properties page, click on Manage Security defaults at the bottom of the page.

How to fix Error

Step 5

After clicking on Manage Security defaults, a side pop-up window will appear.

Step 6

Toggle Enable Security defaults button to No.

Step 7

Click on the Save button.

How to fix Error

Step 8

A success message will show up after the security defaults option is disabled.

How to fix Error

Step 9

Now we should be able to connect to SharePoint Online tenant using PnPjs without any error.

Thanks for reading and I hope you enjoyed this article. Follow C# Corner for more technology-related articles.