In my testing on the desktop, Office.context.partitionKey
is undefined.
In the docs, it states:
Gets a partition key for local storage. Add-ins should use this partition key as part of the storage key to securely store data. The partition key is undefined in environments without partitioning, such as the browser controls for Windows applications.
In the cases where it is defined, what is it partitioning by?
For example, does it refer to:
My intuition would say it should be the first option, however I wasn't able to find anything explicit that references this.
What is the partition key partitioning by?
The partitioning is by an ordered pair of domains:
The domain that the top-level browser window is at, such as excel.cloud.microsoft in the case of Excel on the web
The domain of the add-in, such as contoso.com
So, each of the following would be a different partition:
excel.cloud.microsoft + myAddin.contoso.com
word.cloud.microsoft + myAddin.contoso.com
word.cloud.microsoft + myOtherAddin.contoso.com
The partition key is a hash of the two domains.