Microsoft has recently announced a significant update "Basic Authentication retirement for legacy protocols in Microsoft® Exchange Online"
Microsoft® Exchange Online is deprecating Basic Authentication for multiple protocols prior to its removal in the second half of 2021. Basic Authentication relies on sending user names and passwords -- often stored on or saved to the device -- with every request, increasing risk of attackers capturing users' credentials, particularly if not TLS protected.
Basic Authentication is superseded by Modern Authentication (based on OAuth 2.0). Customers are encouraged to use Modern Authentication prior to the removal of Basic Authentication.
For newly created tenants, basic authentication is disabled by default, and basic authentication will be disabled if the tenant has no recorded usage from Oct 2020.
If new Microsoft® SharePoint subscription Grant App Permission is disabled by default (or) the browser link https://xxxx-admin.sharepoint.com/_layouts/15/appinv.aspx is disabled, To enable this feature, we need to connect to SharePoint using Windows PowerShell and then run set-spotenant -DisableCustomAppAuthentication $false
Run the following commands on PowerShell.
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
$adminUPN="<the full email address of a SharePoint administrator account, example: jdoe@contosotoycompany.onmicrosoft.com>"
$orgName="<name of your Office 365 organization, example: contosotoycompany>"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
set-spotenant -DisableCustomAppAuthentication $false
Fill in the values for the $adminUPN and $orgName variables (replacing all the text between the quotes, including the < and > characters), and then run the following commands at the SharePoint Online Management Shell command prompt:
When prompted with the Windows PowerShell credential request dialog box, type the password for the SharePoint admin account.
Afterward, run https://xxxx-admin.sharepoint.com/_layouts/15/appinv.aspx to grant permission.Generate new token and CRUD operations using REST API on SharePoint should be working by now.
References: