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.
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).
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:
Make a Get request
Check the below post for complete step to be followed: