Validating microsoft office
For more information, see add-in license tokens and anonymous access for Office Add-ins.
Important Do not to parse or otherwise manipulate the add-in license token string before passing it to the Office Store verification web service for verification.
To validate an add-in license by using REST, use the following syntax, where Calling the Office Store verification service from client-side code is not supported. These test licenses are XML fragments that conform to the Office and Share Point Add-in license XML schema structure.
You must use server-side code to query the Office Store verification web service. To import test licenses, use the Import App License method.
Add code to your add-in that takes the appropriate action, based on whether the license is valid and, if it is valid, based on any other license information that is important to you; for example, code that enables the user to access certain features if the user's license is for the paid version, but not the trial version. To call this method, the caller must be one of the following: After you import the test licenses, they appear in the Share Point UI, and you can manage, assign, and delete them.
After you finish testing your add-in and you're ready to move it to production, add code to the license checks in your add-in so that it no longer accepts test licenses. For test licenses, you don't have to specify the deployment ID in the add-in license XML.
The Office runtime treats these test tokens as if they were valid tokens acquired from the Office Store, with the exception that tokens loaded through the registry are not tested for expiration or entitlement type.
These test licenses are strings that conform to the add-in license schema structure.
You can edit your test tokens directly and use them to test add-in behavior code based on different attribute values.If you do use an application that adds a BOM to the token, you must remove this character before passing the license token to the verification service. Omex Token Service; namespace Etoken Web The Office and Share Point Add-ins licensing model gives you a way to include code in your add-in to verify and enforce how it's used based on the properties of its license.When the add-in needs to perform a license check, pass the license token to the Office Store license verification web service for validation. You can load a test license with your add-in from either: Both methods allow an add-in to get the license the same way it would if it were launched from the Office Store or a Share Point add-in catalog.Add code at these points that queries your Share Point deployment for the license token, and then passes that token to the Office Store verification web service for validation.To retrieve the license token from Share Point, use the Get App License Information method.
This prevents users from using test licenses to access your add-in. The Import App License method supplies the correct deployment ID to the license token XML.