Consider a provider-hosted SharePoint add-in installed in a SharePoint Online tenant. When the add-in is activated and contacts its dedicated server-side website I'd like the add-in to uniquely identify the tenant.
From what I've seen, the only bits of data sent from the tenant to the add-in website are in the query string. And of these, only one - SPHostUrl
- identifies the calling site collection.
For example:
?SPHostUrl=https://mytestsite.sharepoint.com/sites/dev
Would it be correct to use the domain name of the host URL as the unique identifier for the tenant? In the example above: mytestsite.sharepoint.com
I would assume a more stable and unique identifier might be available for the SharePoint Online tenant? Possibly a GUID?