----
__❗DEPRECATED: Do not use❗__\\
\\
Back to [SharePoint Integration Link|SharePoint Integration]\\
----
\\
\\
__⚠️ Constraint:__ On newer Sharepoint (after 2019) Grant App permission as it is disabled by default. To enable Custom Application APP Authentication run the following PowerShell commands:\\
{{{
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
$adminUPN="<SharePoint administrator account>"
$orgName="<name of your Office 365 organization>"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
get-spotenant | Select DisableCustomAppAuthentication
set-spotenant -DisableCustomAppAuthentication $false
}}}\\
Or
\\
{{{
$creds = Get-Credential
$orgName="<name of your Office 365 organization>"
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $creds
get-spotenant | Select DisableCustomAppAuthentication
set-spotenant -DisableCustomAppAuthentication $false
}}}

\\
 __Advantage(Compared with MSGraph API Delegated Permission)__: Stream upload supported. There is no temporarily stored local file during the upload.\\ 
\\
__1. Register Add-In__\\
Navigate and log in to the SharePoint online site. Got to the Register Add-In page by entering the URL as: \\
 
{{{https://<sitename>.sharepoint.com/<<site path>>/_layouts/15/appregnew.aspx}}}\\
\\
Click the Generate button.\\
\\
[SharePoint Integration/app_reg_new.png]\\
\\
Store the __Client ID__ and __Client Secret__ and click on __Create__ button.\\
\\
[SharePoint Integration/app_reg_new_success.png]\\
\\
__2. Grant Permissions to Add-In__\\
\\
Navigate to: \\ 
{{{

 https://<sitename>.sharepoint.com/<<site path>>/_layouts/15/appinv.aspx
 
}}}\\
 \\
This will redirect to the Grant permission page. Enter the __Client ID__(generated earlier), in the __AppId__ textbox and click the Lookup button.\\
Provide the permission Request xml and click on __Create__ button.\\
\\
Permission Request XML content: \\ 
{{{
<AppPermissionRequests AllowAppOnlyPolicy="true">
	<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl"/></AppPermissionRequests>}}}\\
 \\
[SharePoint Integration/app_inv_permission.png]
 \\
__SharePoint2 remote item settings:__\\
\\
__User name__ : The created __Client ID__\\
__Password__ : The created __Client Secret__\\
__Site id__ : The SharePoint domain name.\\
__Site Path__: The path of the SharePoint site. It should start and end with a slash.\\
__Drive name__: Each SharePoint site has a Document Library where the site-related files are stored. See [SharePoint: Documents and Libraries Description Link|https://support.microsoft.com/en-us/office/what-is-a-document-library-3b5976dd-65cf-4c9e-bf5a-713c10ca2872] Provide its name\\
__Folder__: Relative path of the document library of the SharePoint site.\\
\\
[SharePoint Integration/sharepoint2_vfs.png]\\
\\