2,524 total views, 48 views today
In this article, we will learn how we can get Tenant ID using the SharePoint Online App Principal (“appprincipals.aspx” ) page. Using the client ID and Client secret we can generate the Tenant ID from the postman tool – but that process is complicated, in this article In 4 steps access SharePoint online data using postman toolwe have explained how we can generate Tenant ID using the postman tool.
Another easier way, we have explain how we can quickly get the Tenant ID from the Azure Portal and Azure PowerShell.
In this article, we will learn quicker than the previous two approaches, how we can get the Tenant ID from SharePoint Online page itself step by step, in order to configure the App Only Authentication, we must follow the below two steps:
Step 1: Register your app on the SharePoint site
Go to this page: “https://<YourSharePointCollectionURL>/_layouts/15/appregnew.aspx”
Click on the create button and Note down the above information:
The app identifier has been successfully created. Client Id: c9a55e05-7b67-4873-97f3-1ce135121c35 Client Secret: 8T2E0dlaOZ4UuRH9bzKEvl8rB9YMQR7SmIIZhUAXDg0= Title: Test App Registration App Domain: localhost Redirect URI: https://localhost
Step 2: Grant permission to your app
Go to this page: https://<YourSharePointCollectionURL>/_layouts/15/appinv.aspx
Enter the Client ID noted from the previous step and click on the “Lookup” button.
Then, inside the permission request XML box enter the below XML:
<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" /> </AppPermissionRequests>
Then, click on the create button.
In the next, page we will get the below confirmation message:
Click on the Trust
Do you trust Test App Registration? Let it have full control of this site. Let it share its permissions with other users. Let it access basic information about the users of this site.
Step 3: Get Tenant ID from SharePoint Online App Permissions Page (appprincipals.aspx)
Go to the page link : https://<YourSharePointCollectionURL>/_layouts/15/appprincipals.aspx
Here we can see the below two pieces of information:
- App Display Name
- App Identifier
In-App the Identifier section, after the @ symbol, whatever we can see is, Tenant ID, and before the @ symbol, is client id.
- Generally, to get the Tenant ID, we use the above two steps 1 & 2 and pass the client id and client secret in the postman tool as a parameter (it has a certain process which is quite complicated).
Thus, in this article, we have learned, how we can get Tenant ID by using the SharePoint Online App Principals page (appprincipals.aspx).
You may also read the below two articles, to get the Tenant ID using the postman tool, Azure Portal and Azure PowerShell:
- In 4 steps access SharePoint online data using postman tool
- How to get Tenant ID using Azure PowerShell?