1

I have developed an SharePoint 2013 app which is AutoHosted. And in that I have implemented License test. I have referred :
1) http://msdn.microsoft.com/en-us/library/office/apps/jj164035.aspx
2) http://blogs.msdn.com/b/officeapps/archive/2012/11/01/creating-and-verifying-

I have published that app on my Office 365 account.

And now I want to know that can I test the code on my local machine? And If yes then how can I do that?

3 Answers 3

1

as someone noted:

It's recommended to use server side code to communicate to Office Store Verification service. But for SharePoint hosted apps, we can't use server side code and we have only one option to use javascript to query verification service. What secure and recommended option do we have for SharePoint hosted apps to talk to Office Store Verification service?

http://msdn.microsoft.com/en-us/library/jj164035.aspx

I think this is what your looking for! your local machine needs internet access tho!

VerificationSvc

The Office Store verification web service provides a method for validating license tokens for apps for Office and SharePoint, and for accessing properties of those licenses.

To access the Office Store verification web service, set a web reference to

https://verificationservice.officeapps.live.com/ova/verificationagent.svc.

The Office Store verification service also supports verifying app license tokens using REST calls. To verify an app license using REST, use the following syntax:

https://verificationservice.officeapps.live.com/ova/verificationagent.svc/rest/verify?token={token}

In this syntax, {token} is the app license token, encoded by a method that complies with RFC 2396; for example, the encodeURIComponent() function in JavaScript, or the Uri.EscapeDataString method in the .NET Framework.

You must call the service URL using the HTTPS protocol.

The Office Store verification service does not support being called from client-side code.

To support app license testing, the Office Store verification web service does not validate the encryption token or any of the attribute values of license tokens where the test attribute is set to true. However, the service does interpret the token, and all the properties of the VerifyEntitlementTokenResponse object returned by the service can be read.

http://msdn.microsoft.com/en-us/library/verificationsvc.aspx

EDIT

If i understood you correctly this is what your looking for!

Testing and handling test tokens: To test your code, place the token file in a local folder along with the app manifest (.xml) file. You can then create a new registry key under [HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Wef\Developer] with a value of the folder name. This will let your app appear under the Developer category in your Word document (see Figure 5), where you can test that it works.

enter image description here

Figure 5. Test your app using the Developer apps category

For more information about creating and loading test tokens, see How to: Load a license token for testing purposes for task pane and content apps.

Handling test tokens also forms an important part of enforcing licenses. You can use this to perform special validation or to handle test tokens appropriately by giving a test experience. The verification service response lets you enable this using the IsTest property.

  if (response.IsTest == true)
              Response.Redirect("./InvalidToken")

http://blogs.msdn.com/b/officeapps/archive/2012/11/01/creating-and-verifying-licensing-in-a-paid-app-for-office.aspx

4
  • Thank you for the answer. But this is what all I have done. I have checked every thing I wrote the code for License test. I have referenced the Verification Service. But I want to check that how does it works. Commented Jun 28, 2013 at 12:20
  • And also that if it is working or not. Commented Jun 28, 2013 at 12:22
  • just ammended my answer
    – Ali Jafer
    Commented Jun 28, 2013 at 13:14
  • Thank you sir for your help. But I have also updated the Question and I have also referred that link. Commented Jun 28, 2013 at 13:18
1

If you are an App developer wanting to sell you App and provide a trial period it's important to understand that it's trivial to "hack" the license check since it's client side Javascript.

Sample script to spoof the license check

0

I have found one Blog (Licensing your apps for SharePoint) that has provided the Example of testing the App License for the local machine.

Thank you for help. From the above you can download the Example also. And it has very good content to understand the license test.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.