none
How to create an add-in xml license for an Outlook app. RRS feed

  • Question

  • I am referencing the following document: https://dev.office.com/officestore/docs/add-in-license-schema

    The doc says that the <d> element contains a token used by the Office Store verification service to determine whether the add-in license token is valid. This is an encrypted signature derived from the literal string contained in the <t> element.

    When you submit a test add-in license token to the Office Store verification web service, the service does not perform that validation check of comparing the encrypted signature in the <d> element to the string contained in the <t> element

    How do I create the t element?

    Where do I put the encrypted version of the element?

    Will the element be passed to me as a get parameter in the test environment?

    Again, could  you please post a JavaScript example of the verification process.  I can't find any references to it.  This is especially puzzling to me because all processing in the add-in is supposed to be via JavaScript. 

    --Ephraim


    -- Ephraim


    • Edited by EphraimF Friday, April 28, 2017 6:54 PM
    Friday, April 28, 2017 6:48 PM

Answers

All replies

  • Hi EphraimF,

    currently , we only have the below example to check license.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections.Specialized;
    using System.Text;
    using EtokenWeb.OmexTokenService;
    
    namespace EtokenWeb{
    
        public partial class EToken : System.Web.UI.Page{
            public string etoken = "";
            private static VerificationServiceClient service = new VerificationServiceClient();
    
            protected void Page_Load(object sender, EventArgs e){
               
                etoken = Request.QueryString["et"];
                if (etoken != null)
                {
                    Response.Write("my value:" + etoken + "<br>");
                    CallVerificationService(etoken);
                }
                else
                    Response.Write("no token provided<br>?");
            }
    
            private void CallVerificationService(string etoken){
                VerifyEntitlementTokenRequest request = new VerifyEntitlementTokenRequest();
                request.EntitlementToken =  DecodeToken(etoken);
                VerifyEntitlementTokenResponse  omexResponse = service.VerifyEntitlementToken(request);
                Response.Write("Is Test:" + omexResponse.IsTest + "<br>") ;
                Response.Write("User ID: "+ omexResponse.UserId + "<br>") ;
            }
    
            private static string DecodeToken(string encodedToken){
                byte[] decodedBytes = Convert.FromBase64String(encodedToken);
                return Encoding.Unicode.GetString(decodedBytes);
            }
        }
    }
    

    I will try to find further if any documentation available on it then I will try to provide it to you.

    if no any example available then I will try to request for an example.

    Regards

    Deepak


    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.

    Monday, May 1, 2017 9:16 AM
    Moderator
  • Thank you.

    I'm awaiting your response.


    -- Ephraim

    Monday, May 1, 2017 8:15 PM
  • I figured it out.

    Thank you.


    -- Ephraim

    • Marked as answer by EphraimF Tuesday, May 9, 2017 4:19 PM
    Tuesday, May 9, 2017 4:19 PM
  • Hi Ephraim,

    Can you please share us how you solved and obtained the token. i am struck up in same place.

    I mean test token that can be used to validate the add in.

    Some code part will be much appreciated.

    Thanks in Advance.

    Siva.

    Thursday, March 15, 2018 4:45 PM
  • Hi Siva SP,

    You can refer the same code example I posted above to check for token.

    Regards

    Deepak


    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.

    Friday, March 16, 2018 1:26 AM
    Moderator
  • Siva,

    If you still need help, I'll be happy to provide it.  

    Please let me know.

    --Ephraim


    -- Ephraim

    Tuesday, March 20, 2018 5:55 PM