The MSDN docs say "if multiple licenses are purchased for the same app by using different Microsoft accounts, the licenses are returned in the following order of priority: Paid, Free, Unexpired Trial, Expired Trial."

My question is what am I supposed to do when multiple licenses are returned? Is it OK to always take the first license and verify that one, as every example I have found does? Iterate through all of them until I find a valid one? Iterate through all and reject if I find an invalid one?

It's confusing because licenses are really for a user but if the user has been assigned to a Trial license but not the Paid license why would the framework even return the Paid license?




I am answering my own question in case it helps someone else.

I found the link below which explains "However there is the possibility of two different purchasers buying the same app and assigning a seat to the same user, in that case the call would return multiple licenses. The API is designed to return the most "relevant" license first so in general you should be ok by looking just at the first license." The author of this statement is an expert on the subject in my opinion (based on this and other articles that I have found from him).

So basically I am going to just use the first license returned for validation.


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.