4

I am trying to create a simple PHP script that uses oAuth and I seem to require the Tenant ID of my SharePoint Online account. I'm sure this is something very straight forward, but I can't seem to locate it.

Thanks!

5

I found this approach (blog.scoreman.net) easier:

Navigate to https://.sharepoint.com/_layouts/appprincipals.aspx. Identify the row with your registered application and look at the App Identifier column. The unique identifier after the @-sign in the App Identifier is the app realm. Copy the realm (not the whole App Identifier just the last part after the @-sign).

| improve this answer | |
1

Tenant ID is nothing but SharePoint Online Site Realm.

You can get this by having a REST call to the site API.

Follow below steps:

Header: Authorization: Bearer

  • Get the Bearer realm component from the response header and save it.

Check the below post for complete step to be followed:

http://spshell.blogspot.in/2015/03/sharepoint-online-o365-oauth.html

| improve this answer | |
1

You can get the the Tenant ID from the Azure Active Directory admin center. Navigate to https://aad.portal.azure.com/ and the select Azure Active Directory in the left navigation. The Overview page displays the Tenant ID.

Azure Active Directory admin center

| improve this answer | |
0

easiest approach which does not require authentication is here.

for SharePoint Online and Office 365 Tenant id is the same as Azure directory id.

https://login.windows.net/<tenant-name>.onmicrosoft.com/.well-known/openid-configuration

above URL will return JSON for open id connect. Extract guid from token_endpoint property. extracted GUID is your Tenant Id(Tenant Id and directory id is same)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.