locked
Outlook add-in license client-side validation via REST/JavaScript RRS feed

  • Question

  • I’m really at a loss.

    I can’t find any documentation concerning this topic.  I see lots of documentation for doing this in C#.

    Some of these documents contradict others, others are obsolete, and there are no examples I can find for doing this in JavaScript.

    I can’t get my add-ins accepted by the Microsoft Store until I get this to work.

    Please help.

    • Moved by Chenchen Li Thursday, May 4, 2017 6:43 AM Publish to Office Store
    Monday, May 1, 2017 9:00 PM

Answers

  • Hi,

    Please change the DefaultValue into a string including a test token

    For Outlook add-ins, the et query parameter string is only URL-encoded, and not base-64 encoded.
    For example, the source location modified to include a test token for an Outlook add-in would look like this:
    https://myApp/index.htm?et=%3Cr%20v%3D%221%22%3E%3Ct%20aid%3D%22WA104108294%22%20pid%3D%22463eafac-c123-45fe-bd21-b1b120b4c12b%22%20cid%3D%223BEC2F1C0124D801%22%20did%3D%22CONTOSO.COM%22%20ts%3D%221%22%20et%3D%22Paid%22%20ad%3D%222013-08-29T21%3A38%3A14Z%22%20sd%3D%222013-09-17%22%20te%3D%222013-12-23T09%3A10%3A42Z%22%20test%3D%221%22%20ss%3D%220%22%20%2F%3E%3Cd%3E7uM9j2%2FYZJeZrrm2TLjXufQlwkAXkq2RqjowBP9fAjo%3D%3C%2Fd%3E%3C%2Fr%3E
    Due to the limitation of community support, if you want to contact the Microsoft professional supporter working close with you to troubleshoot this issue.
    You could create an incident with the following steps:
    1. Open https://support.microsoft.com/en-my 
    2. Get More support-> Developers
    3. Developers-> Visual Studio, Microsoft imagine, BizSpark and WebsiteSpark-> Microsoft Technical Support
    4. Select Office-> Outlook 2016
    5. Select the third option "I use it as an IT Professional, developer or Microsoft partner"-> Next
    6. Create an incident-> Programming and Extensibility-> Apps for Outlook
    7. Start request

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by adldata Monday, May 15, 2017 4:11 PM
    • Unmarked as answer by adldata Monday, May 15, 2017 5:23 PM
    • Marked as answer by adldata Tuesday, May 16, 2017 3:34 PM
    Thursday, May 4, 2017 6:27 AM

All replies

  • Hello,

    Please visit https://blogs.msdn.microsoft.com/officeapps/2012/11/01/creating-and-verifying-licensing-in-a-paid-app-for-office/ to see how you can add logic to enable licensing checks inside your code using the Office verification service.

    For more information, you could visit License your Office and SharePoint Add-ins & Add license checks to Office and SharePoint Add-ins

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

    • For Office Add-ins, you are required to use server-side code to query the Office Store verification web service.

    For Outlook add-ins:

    • Create your test token.
    • Create a URL-encoded version of the add-in license token.
    • In the add-in manifest file, manually edit the appropriate  SourceLocation element. Add the URL-encoded version of the license token to the source location URL as a query parameter named et  .

      Note:  If your add-in uses  getUserIdentityTokenAsync, adding to the  SourceLocation element in the manifest will change the URL in the token because the token generation is based on what is in the manifest. When you test the license token, you will have to modify the validation call on your service so that the validation will accept the modified URL. For example, if you use the managed API token validation library, you will need to change the hostUri parameter to match the modified SourceLocation. Remember to change the Exchange identity token validation call back after you test the license check.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 2, 2017 3:13 AM
  • Thank you Celeste.

    I can't find how to modify the SourceLocation element to include the license token.

    The only definition of the SourceLocation element I've found is here: https://dev.office.com/reference/add-ins/manifest/sourcelocation , and it doesn't list any element for the token.

    As far as the app extracting the token, for an Outlook add-in, the documentation says it must be extracted from the 'et" parameter in the GET Query string.

    Also, I can't register the Verification Service in Visual Studio for this JavaScript application. The screen shots for adding the service don't match the menu in Visual Studio.

    It would be great to be able to speak to a live person for five minutes -- I could get all my questions answered.

    Thank you.


    • Edited by adldata Tuesday, May 2, 2017 6:30 PM
    Tuesday, May 2, 2017 5:37 PM
  • Hi,

    Please change the DefaultValue into a string including a test token

    For Outlook add-ins, the et query parameter string is only URL-encoded, and not base-64 encoded.
    For example, the source location modified to include a test token for an Outlook add-in would look like this:
    https://myApp/index.htm?et=%3Cr%20v%3D%221%22%3E%3Ct%20aid%3D%22WA104108294%22%20pid%3D%22463eafac-c123-45fe-bd21-b1b120b4c12b%22%20cid%3D%223BEC2F1C0124D801%22%20did%3D%22CONTOSO.COM%22%20ts%3D%221%22%20et%3D%22Paid%22%20ad%3D%222013-08-29T21%3A38%3A14Z%22%20sd%3D%222013-09-17%22%20te%3D%222013-12-23T09%3A10%3A42Z%22%20test%3D%221%22%20ss%3D%220%22%20%2F%3E%3Cd%3E7uM9j2%2FYZJeZrrm2TLjXufQlwkAXkq2RqjowBP9fAjo%3D%3C%2Fd%3E%3C%2Fr%3E
    Due to the limitation of community support, if you want to contact the Microsoft professional supporter working close with you to troubleshoot this issue.
    You could create an incident with the following steps:
    1. Open https://support.microsoft.com/en-my 
    2. Get More support-> Developers
    3. Developers-> Visual Studio, Microsoft imagine, BizSpark and WebsiteSpark-> Microsoft Technical Support
    4. Select Office-> Outlook 2016
    5. Select the third option "I use it as an IT Professional, developer or Microsoft partner"-> Next
    6. Create an incident-> Programming and Extensibility-> Apps for Outlook
    7. Start request

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by adldata Monday, May 15, 2017 4:11 PM
    • Unmarked as answer by adldata Monday, May 15, 2017 5:23 PM
    • Marked as answer by adldata Tuesday, May 16, 2017 3:34 PM
    Thursday, May 4, 2017 6:27 AM
  • I added the et= parameter to the DefaultValue as follows:

            <SourceLocation DefaultValue="https://localhost:44384/AppCompose/TaskPane/TaskPane.html?et=%3Cr%3E%0D%0A%20%20%3Ct%20%0D%0A%20%20%20%20aid%3D%22WA900006056%22%20%0D%0A%20%20%20%20pid%3D%22%7B4FB601F2-5469-4542-B9FC-B96345DC8B39%7D%22%20%0D%0A%20%20%20%20cid%3D%2232F3E7FC559F4F49%22%20%0D%0A%20%20%20%20did%3D%22%7B0672BAE9-B41B-48FE-87F1-7F4D3DD3F3B1%7D%22%20%0D%0A%20%20%20%20ts%3D%2230%22%20%0D%0A%20%20%20%20et%3D%22Trial%22%20%0D%0A%20%20%20%20ad%3D%222012-01-12T21%3A58%3A13Z%22%20%0D%0A%20%20%20%20ed%3D%222012-06-30T21%3A58%3A13Z%22%20%0D%0A%20%20%20%20sd%3D%222012-01-12T00%3A00%3A00Z%22%20%0D%0A%20%20%20%20te%3D%222012-06-30T02%3A49%3A34Z%22%20%2F%3E%0D%0A%20%20%3Cd%3EVNNAnf36IrkyUVZlihQJNdUUZl%2FYFEfJOeldWBtd3IM%3D%3C%2Fd%3E%0D%0A%3C%2Fr%3E" />

    I also created a token file in ...bin\Debug\OfficeAppManifests (substitute "Debug" with "Release" if your project is configured for Release builds). This folder is created automatically after the first time you build or debug your project.  (per https://dev.office.com/officestore/docs/add-license-checks-to-office-and-sharepoint-add-ins).

    Incidentally, the .tok file disappears while debugging the app.

    I get an et="" parameter passed into home page of the URL.

    Please help.

    • Edited by adldata Tuesday, May 16, 2017 4:24 AM
    Monday, May 15, 2017 5:39 PM