0

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?

1

The query string variable SPHostUrl is your only bet in present implementation of App Model if you are creating a Multi-tenant Provider-hosted application.

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.