In this “How to get Tenant ID” article, we will learn how we can get a 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 the postman tool has explained how we can generate Tenant ID using the postman tool.
Another easier way, we have explained 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:
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 – How to get Tenant ID
Go to this page:
Permission Request XML for SharePoint Online AppEnter 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.
On 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 :
Here we can see the two pieces of information:
- App Display Name
- App Identifier
In-App, in the Identifier section, after the @ symbol, whatever we can see is, the Tenant ID, and before the @ symbol, is the 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).
Summary: How to get tenant id
Thus, in this article, we have learned, how we can get a Tenant ID by using the SharePoint Online App Principals page (appprincipals.aspx).
See Also: How to get tenant id
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?
- Find your Microsoft 365 tenant ID